Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have Long Text that I've saved it in file. My Question is if I Read Directly from file is Fast or for First time I save it in SharedPreference and for next time I read from SharedPreference is Fast?
I don't think that speed will be your only concern. If it is, than Sharedprefs looks faster too me. However you are talking about millisecs difference here.
To be sure, use log to capture time and start measuring.
You should be more concerned about other stuff, like the amount of data you are going to write, the sort of data. Etc. etc.
SharedPrefs is faster,basically it store the value with key pair.you can't do everything in Sharedprefs.u have to choose depends upon requirements
for more details go to the link
http://developer.android.com/guide/topics/data/data-storage.html
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm a beginner in android atudio, I recently make my first app, I put in many raw resources file(txt,mp3) that is why it's size is big (~200Mo).
I want to allow user to download what he need in order to benefit my service like listen to mp3 read text.
You should carefully consider why you need this much data in your app, remove all unnecessary parts and put everything you really need into the .apk as resource.
If I find some app is downloading 200MB to my phone, I'll uninstall that immediately.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am new to android programming and I'm currently working on a todo list app. I would like to store the name of the task and if it is completed or not. Later I might add things like priority or a date when the task has to be finished. I'm just unsure which method of storage i should use. Would SQL, JSON, XML or maybe something else like a CVS file be best fitted for the task?
You don't have to show me how to implement that method, I am just curious which method would be best suited.
Tanks for all answers
As for me, if you want some addition scalability from your app in future - it's better to use database. Preferences are not for storing large amount of data, but maybe they take less time for implementation. Don't store in xml/json if you are going to increase stored fields count, it would be a mess after some time.
If it's some kind of self educational project maybe you would like to use firebase or maybe realm, but it's only if you want to get something new. SQLite would be enough too.
This is more of a pref. Question. But, XML is pretty much the standard.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
To put a lot of searchable text in a software, what would be the best method, database or File-Handling system? Keeping in mind that the text is an Asian language with right-to-left orientation. Platform is Windows and Android.
Database is the better option. It has structured format of all your stored datas. Database allows you to fire queries and search for a particular text you want. You can store and fetch data very easily and with good performance speed. You can also delete any unwanted texts which is easy part.
Now incase of File, It is unstructured format kind of data. All your data gets stored below one another in line by line or. Fetching a particular word from bunch of whole paragraph is tedious job. Even You need to hold whole file's object all the time, which occupies more memory.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to create an application that will show me on a map to all users who have installed my app within x distance.
It wondered if I need to save the coordinates of each user periodically in a database and read the position or is there another option
Tracking the user's location in a database will likely be your easiest option. It will also scale well. If you are only tracking a couple users, you could use another simpler data storage mechanism like an XML file, a text file, or even some sort of Application Level Variable.
I'm sure that you have done some research on how best to track your users, but this is a pretty good starting point, if you don't have one already. They are storing each location in a local database on the phone, so I'm sure that you could very easily modify it to send that same location to a web service or something.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
In ym android app, I have Settings menu in which use sets their app mode, sound, music ...etc
I retreive/store this in from/in shared preferences.
My question is onceI retreive this info, where is the best place to store it to make accessible by my whole application?
So far what I do is I read it from my mian activityu and sent it as an Extra between activities but something is telling me it is not efficient/correct way. Should I store the info in the Application class so any activity can access it while the app is running
Thank you
Why not just grab it from SharedPreferences every time you want the value? This saves you from having two copies of the same data in the application which could potentially get out of sync.
I'm assuming you don't need to poll these values thousands of time per second such that it would have any kind of meaningful performance impact.
Further reading:
Don't Repeat Yourself - Wikipedia
You should create a static class named like configuration.java, where you can put all the configuration/setting.