It's possible to create an offline app using flutter - flutter

I want to develop offline book reading app using flutter. There is any way in flutter so that user can access book offline.

you can put data in form of json and load data when you requires it
you can read more about it here
https://flutter.io/assets-and-images/

You can download the images/pdf files of your book in the device storage (External Storage) by asking user like
"Hey! Do you want this to be available offline? Cool, click the button and grant the storage permission in order to proceed".
After this, you can download the files from the server in device external storage and use it. Simple!

Related

Which alternative to "Firebase Storage" could I use for my Flutter App?

I'm developing an app with Flutter and I need a lot of database storage to store my data (images and videos).
Currently I'm using Firebase for:
"User Authentication, Firestore Database, Dynamic Links, Storage and so on"
The pricing for the storage (GB stored) itself is ok for me but Firebase also charges for GB Transfered and Operations(uploads & downloads) which can get expensive as you can see in the snapshot below:
I am actually looking for an alternative to Firebase Storage which does not charge for Data transfer of Operations (at least sth. which is not that expensive).
Does anyone know which cloud storage I could use instead and also how to migrate in my flutter app?
I'm also open to use a own server running on a VPS but I have no clue how I would establish a connection to the own server in order to be able to up- and download media files.
Please provide a tutorial/instructions how to build your own server and connect with flutter app since I'm interested on anyway.
I would recommend using Supabase, it's a Firebase alternative and it's open source, supports Flutter/Dart and supports the storage service.
Check it from here Supabase storage
you could configure it and use it with your own hosting, and it will cost you only the price of hosting it on some cloud service, where you will store your files.

Which database should I use for my flutter app using lots of images?

I want to build a flutter app which focuses on learning plant names with the help of a lot of pictures. In total there will be 600-800 pictures.
question: Do I store these pictures all in the app or in a database?
From what I read so far I guess the app would be too big if I store all these pictures in the app.
question: Which database should I use for storing such an amount of pictures?
I want to give the possibility to store a lection/course (containing 30-40 pictures) locally on the phone to be able to learn without internet connection.
question: Which database should I use for that?
Question #1: Do I store these pictures all in the app or in a
database?
You should not store all the images in your app. Use the Cloud Storage for Firebase service to store your pictures and download them to your app as desired.
Question #2: Which database should I use for storing such an amount of pictures?
You should use Cloud Storage for Firebase to store your pictures: "Cloud Storage for Firebase is built for app developers who need to store and serve user-generated content, such as photos or videos."
Question #3: I want to give the possibility to store a section/course (containing 30-40 pictures) locally on the phone to be
able to learn without internet connection. Which database should I use
for that?
You can save these pictures locally as explained here in the Firebase doc: "The writeToFile() method downloads a file directly to a local device. Use this if your users want to have access to the file while offline."
If in a database, get pic to many times, and much more than the free limit of database , we will prefer pic in app than in database.
But in app will never consider the cost, just keep the develop account. Maybe, a pic could compress down to 50kb each, and the app will not too big to download.
mongodb google-could amazon ... all database on the market can serve you.
above dbs are good. the more resourses on net, the better envirnment we like.

How can I run the application without internet?

I am making a new application with Flutter. Products are listed on the web with api. But I wonder,
The user opened the application and all products from json appeared in the application. Then I want him to see the same products when he closes the internet. How can I do this, what do I have to investigate?
for offline viewing:
Using sqflite for storing image and text (json)
or
Using cached_network_image for image caching & sqflite for storing text (json)

Firestone offline capabilities flutter

I know that Firestone will store data if the user is offline and I saw that there is a way to do this with native code, but is it possible to enable these offline capabilities in flutter itself?
Firebase firestore support full offline. I’m using it myself. So long as you’ve read the data at least once before going offline. If using firebase authentication - the custom option also works offline. Google sign-in does not.
The downside to firebases offline capabilities is that it’s only firestore (not counting the older firebase db) and not the other products like cloud storage.
So for example I’ve written an app and the document side of it is fully offline enabled however you can take photos in the app and I had the write the offline capabilities to sync this photos with firebase cloud storage myself.
(I basically just keep them in a pending folder and try to sync them when the device has connectivity.)

Application users account registration and login, best way to handle?

First of all, i'm new to Objective-C, so please be patient with me.
I want to add to my application users account management, users can register/log-in into a personal account that will synchronized with database on the internet. I dont have a clue how to do that. I know how to work with sqlite3. I was thinking maybe to create an sqlite3 database on the device. is it possible to store images into sqlite3 database? is it the best and efficient way to manage users on application?
what does sign in with Facebook or Twitter do? is it possible to add them both and another option for someone who doesn't have Facebook or Twitter?
What is the best way to handle account registration and login on iPhone?
Thanks alot!
I want to add to my application users account management, users can register/log-in into a personal account that will synchronized with database on the internet.
AFNetworking or ASIHTTPRequest can help you with this. create a web service api, maybe in php + mysql or any web scripting language you prefer, from the device you can POST your data like username and password and do the logic in your web service.
I was thinking maybe to create an sqlite3 database on the device. is it possible to store images into sqlite3 database?
what is your plan here? why would you create a database on the device? do you want to manage the users locally? if yes, that would be easier and more efficient because you dont need internet connection to create a request to server. and yes its possible to store images in sqlite by storing the image as blob
what does sign in with Facebook or Twitter do? is it possible to add them both and another option for someone who doesn't have Facebook or Twitter?
Yes its possible. you can have three log in options. facebook, twitter, and your custom log in option. if you want to integrate facebook and twitter on your app. there are many tutorial and docs you can find there.
I suggest: this for facebook and download the sample app
What is the best way to handle account registration and login on iPhone?
it depends on your app requirement, if you dont need to store your user data in a database on a cloud server, the best way is to create a local database on device.
This is a broad question - so the answer is going to be very general, little of which has to do with Objective-C, iOS, or Mac specifically.
It sounds like you are creating an application on a mobile device that needs to synchronize data with a database for which the mobile app is a client. One way of managing this is to start with table of users and credentials on your server, e.g. in MySQL. Then you need to write the API on the server side, e.g. in PHP, Rails, Python, etc. Then you will write the web service code on the device that interacts with the server's API.
If you are new to developing on iOS, then I would suggest running through some tutorials on consuming web services, first. That is, I would learn how to connect to pre-existing web services first. You might want to check out the AFNetworking library for Mac and iOS. It has some demo applications. But if you want to stick with the native URL loading system on iOS, there are numerous tutorials available. (Here's one)
I should mention another option is to use Amazon Web Services SimpleDB. There is an iOS SDK. It allows you to execute queries directly against the db without writing the server-side code.
You mentioned sqlite3. This will allow you to manage data on the device; but you state that you want to sync data with some resource on the internet. You can store images in sqlite3; but you can save yourself a lot of hassle by looking into Core Data as an alternative.