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.
Related
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'm creating an app where I'm going to be storing data that the user enters. Let's say for instance it's someone weight. I have created an SQLite database that is able to store this information. However, I want the user to be able to update the value if the weight changes, but I don't want to lose the previous data. Would I have to create a separate database to store this past information? Or is there a more effective approach? Thanks for your time.
I am completely new to android. I am trying to build an app, where the user can save few mobile numbers.(In setting activity of the app)
And I have a button in the main activity on clicking it i need to send a pre defined message to the contact numbers which was already saved by the user.
So should I write down the numbers entered in a file internally or is there any other concept that will save the data entered by the user and use it for the apps further use
You can use SharePrefrence or Sqlite Database to save value, So that you can retrieve it later whenever required Tutorials to use are below:
SharePrefrences:
http://www.tutorialspoint.com/android/android_shared_preferences.htm
Database:
http://www.tutorialspoint.com/android/android_sqlite_database.htm
SqliteOpenHelper suits best for this case. You can store all the numbers in the sqlite database and there are number of tutorials for knowing how to use it.
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.
I am making an expense log application. The user can create a log by adding a picture of an object and then add the price and some comments to it.
I would like to know if I need to use database to store that data or i can store it directly to the phone.
There are several ways you can store data in Android application: SharedPreferences, files, SQLite databases, etc. Which one you choose, depends on your requirements, amount of data you need to store, etc. I suggest you read Data Storage section in the Android developer's guide to get started.
For your case a databse is the best fit. You could put all expenses in a String array in the SharedPreferences but this would be horrible to use. You would always need to load all expenses to memory if you are searching for one and so on. A database allows searching, filtering and ordering through SQL. It is a bigger initial amount to create the Database but the management of the data will be much nicer afterwards.
Demonick is right about the images, only store the path to the image file in the database and then retrieve the images from there. If you are storing images on the SD-Card the user or other apps can access and delete them so don't count on them to be available later.