I wanted to know how to create something like this to save information, after a form has been filled out? This is from the App Timetable and I couldnt get any information on how to do this? Any Suggestions/Solutions?
Regards,
Michael
Refer this information on Android Developers website for Storage Options in Android.
You will read if you need to store large amount of data you need to create a Sqlite Database but if you need to save small amount of data then Shared Preferences will do.
Now you need to save and retrieve data from these storage options.
1) Shared Preferences Tutorial
2) Sqlite Database Tutorial
I assume till now you have done with saving and retrieving data . Now you need to match your current time with saved time in your app like a Alarm clock do. For that you need to implement a service that will tell you how much time is left in your task or what is upcoming event.
Tutorial on service.
Related
... or can I acess it remotely? If yes, where/how?
To illustrate my question with an example:
If I want to implement a login function and an user creates an account: will his login information only be stored on his phone? (So he can only login on his phone on nowhere else?) Or is it stored somewhere else?
I'm quite confused at the moment and wasn't able to find good ressources zu answer my question (maybe someone knows a good tutorial?)
Thank you in advance for your answers!
There are mainly 3 ways to store data in android:
With the shared preferences, you can save data locally. Its limit is that when you close your app the data are deleted.
With SQLite the limit of the shared preferences is overcome. You can save data into a binary file stored locally in your phone. For use it you have to write some specific java code and inside it write in SQL sintax. It is used for example to keep the highest score in single player game, or simply to let the app remember description, text, user inputs.
With Firebase you can save data in a not local way, data are stored in a server. You can use it for example for develop a social, a game that need to share data with more users, when you have a multiuser application.
This is a data file storage overview, it could be useful too.
For login data it's better to use share preference instead of SQLite. If you use SQLite or Room or share preference, data are saved locally and you can't access them remotely.
I am currently creating a wiki-like application and currently have multiple large paragraphs of text that is required to be stored. What is the best way to store such information? Should I use a database or just put all the information in a text file or even just store the information as a string in xml? The information won't be able to be altered currently by users but I might change that in the future possibly?
Just wondering whats the best method :)
Thanks
For large data it's better to use a database (more control of data flow and more structuring), and keep in mind if you want to work with android database use it just for storing information that is needed when user is not connected to the internet or certain information that is important for the user.
scenario related to your app:
- An article that the user selected as favorite
And keep the unnecessary data on your server.
To use the android database, ROOM is a good start, find the link below to start implementing ROOM in your application:
https://developer.android.com/topic/libraries/architecture/room
If you need further information feel free to ask
I am developing a places of interest app which will display the list of places of interest in a location.
When user chooses one, it will display more information and address etc.
How do I store all this data? Currently I am using a text file to store all the data and subsequently when user chooses a place, it will parse the text file and retrieve the necessary data for display.
Any advice on what is a better way to do this? I looked at SharedPrefs, but it is more like storing "key-value" pair and in this case I need to store a large amount of data.
I want the info to be available even when the device is offline, thus I can't download from an online server upon request.
Any other way to do this?
You may store it to XML file using XML serializer, here is very good tutorial for learning that,
http://www.ibm.com/developerworks/library/x-android/
and it can be easily parsed using Java XPath Api. Have a look at this at parsing XML files
http://www.ibm.com/developerworks/library/x-javaxpathapi/
Use SQLite
It can store large data.
It is available offline.
All your problems will be sorted out.
Hre we have a wonderful tutorial for sq-lite
http://www.vogella.com/articles/AndroidSQLite/article.html
How about a relational database?
http://developer.android.com/training/basics/data-storage/databases.html
Take a look at Serialization. If you do not need database access, you could define a class what holds every information you need. Then, you can do the following:
when you need to save the datas, you serialize your object, dumping its content to a file, for example on the SD card
when you want to load the datas, you just load the above mentioned file, and get back everything from the dumped file
I am using this method in my app to cache some datas that would need internet access, so the user can still view it, and with proper implementation, this can work very nicely.
Use database, create table and insert all the data in it. When you need the data just fire the query, and you are done.
SQLite is fine for Android.
Depending on the type of data you want to store, you could use a SQLite Database (provided with Android) if it has a normal database structure. You could Serialize your data and save it in a raw or encrypted file, making you data implement Serializable.
I am developing an application in which i am getting data through Json which includes text, images both. When user runs my application for the first time, data should be stored somewhere so that next time he/she can run the app without using internet. Can anybody suggest me any solution?
Shared Preferences is the best option for you as it is permanent light-weight storage in android.An good example of shared preferences in android is to storing Highest score of game in your device.See here.
For my newest app it it one that will save multiple EditTexts where the user can enter stuff.Like say if it was a note app,how would i get them to save?
There are multiple ways to store data on Android. Read about data storage.
In your case you might have multiple text records with some metadata (time when created, etc..), so I'd recommend the database.
Check out how to store preferences with android's "SharedPreferences":
http://www.javacodegeeks.com/2011/01/android-quick-preferences-tutorial.html
This way you can indefinitely store whatever you're working with as a string, object, etc. Also, you can check out how to work with android's SQLite Database, which might be harder to figure out when you start working with it, but it gets easier over time.