android - dictionary to translate strings [closed] - android

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 5 years ago.
Improve this question
I have a lot of String code values that come from server, and I want to translate this codes to strings.
I can get key and value (code : string) from server every week and store/update them.
What is the best way to store, update, and read/use this data, over whole activities of app?
Thanks.

You have the following alternatives:
Shared Preferences - a persistent key value store. You can write values, that are stored to files, that are accessible in the app context.
Database - use the built-in SQLite instance or a third party DB of your choice. The data is persisted and also accessible from within the app context. Extracting the values may be a bit over complex for your case.
Plain files in a custom format that fits your use case - you can create and store files that are private to your app and store and extract info from them. You will have to deal with the file format and operations in a custom way.
As a whole, fetching your string resources from the network is not a very good approach. In this way you have to deal with localisation and internationalisation in a custom way and can't use the built-in goodies provided by the Android OS.

Related

Android with Kotlin best ways to storage a custom class [closed]

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 2 years ago.
Improve this question
this is the first time that I need to store some data permanently so I would like some suggestions before to proceed. I've read that there are different ways to store data on an Android device:
Internal storage
Shared Preference (but if I've understood is just for symple data like an option)
Shared storage (but I don't need to share data among other apps)
Database
I can't understand what is the best option for me between the first and the last.
My case
I have a list of book with title, subtitle, cover image and each book contains a list of cards with title, optional image, (audio if possible), other stuff.
So, I have to store an arraylist of a custom class that includes another arraylist of anothercustomclass and some text/image
Which approach should I take?
Thanks
Frankly, the case description is much too limited to give an informed advice (so the question should be closed).
But if you have doubts, then the safe / default choice is the database. It might come with big overhead for some cases (like when it's enough to serialize the whole arraylist to a blob and store as a single file), but you are less likely to paint yourself into a corner.
Addition (after a comment)
When using a database, you don't store objects directly (because what an sql database stores are "relations" which you can think of as "sets of rows", not objects). Instead you have some code (custom or from a library) that translates an object into a row (or multiple rows) for storage and some code that translates it the other way.
If you want to store the actual objects, then serialization to a file is pretty much the only way.

Best practice: store image and text in Android [closed]

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 2 years ago.
Improve this question
I am doing a simple app where I take a picture, fill some text from the UI and store the image + text together.
Eventually the user can select the picture from a recyclerview and edit the associated text (or delete the whole image + text group).
I have no hint on what kind of data structure should be used.
I heard that SQL lite should be used for such tasks - since the text data could change according to the user actions, but I think that using tables (one or more) for the purpose of storing images and text could be overkill - also because I don't expect to have a lot of images in my app.
I'm wondering if any other data structure is available for this purpose (similar to C strctures, or python dictionaries).
Also, any kind of hint about keyword to search for this topic or resource would be really appreciated.
Just for the sake of discussion, I am developing using kotlin.
For storing images, you should store them as files, and store file paths of those images in the database with text. Moreover, when you read it back you can use Picasso or Glide to load those image paths into ImageView.
Also, if you want to store images in external storage, make you request runtime-permission and add permission to the manifest file.
However, if you store files in internal storage, you don't need to request permission.
Learn more about Runtime-Permission and Storage in Android.
I would suggest use Room for working with SQLite in Android.

The optimal way of storing data from an android list, then exporting it to sync with a master database [closed]

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 6 years ago.
Improve this question
I'm basically creating an android application which takes around 8 forms (forms consist of EditText field and CheckBoxes) and will store them in a database, so that it can be later synced/added to a pre-existing database (Microsoft SQL 2008).
Which would the best way to store and sync (maybe daily or weekly) data to a pre-existing database in my case. I do not have much experience in android backend, as I've only ever worked with shared preferences to store data locally, so a simpler solution will ease this process. Cheers!
Edit:
TLDR: This question was asked to find out, which route shall be taken when one needs to store data taken from a form filled by the user so that it can be later synced with an existing database (which in my case is a Microsoft SQL 2008). The main aim of the android application was get the various databases and push it to the cloud.
As of 24/1/17: I've created a SQLite Database and have begun storing the data, I'm still not sure which method would be the best to export the data. I will keep on documenting the progress.
You could look at azure cloud services link, you need some knowledge about odata.
or
You could try firebase link, understanding of json is required.
Because you have knowledge about sql I suggest you have a look at some tutorials for linking sql with azure or sqlite with azure.
Use a POJO and store them to firebase. Check this and this or watch this video. hope it helps.

best way to get the data from database [closed]

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 was designing the classified app in android which takes the data from the db hosted at run time. I have designed it and it is working fine but it is very slow as application has to fetch the data from the server and which take much time. I want to reduce the time by some way that user get the data immediate and also can get the data offline with out internet.
Can any one suggest me the best way for store the data in the mobile app or any other way?
can i create a xml and store it on user mobile?
Please let me know.
thanks in advance.
itin
One way is to do this by ContentProvider.
Another way is to use a framework like ORMLite, an Object Relational Mapping.
In my opinion you have two good methods . Fist one ;use store procedures ,triggers and functions to get data from database .Second method get data by using service like json do not use xml(soap).

Storing data on Android for offline access [closed]

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 9 years ago.
Improve this question
what are the best practices to save content data when the device is offline or when you have already downloaded some content that shouldn't be retrieved from server again?
Is SQLite the best approach to achieve this? If the information that I want to store is retrieved from an API as a JSON should I create a database structure to parse and insert it?
I know that the above are different questions but the purpose is the same.
Using Sqlite is a bad idea as it is extremely slow and takes up a lot of unnecessary space. When possible serializing objects or using SharedPreferences should be prepared to sqlite (unless of course you have a database structure). For caching and storing data pulled from the internet, I recommend robospice: https://github.com/octo-online/robospice. It's a very well done library, easy to use, and should be used any time you download data from the internet or have a long-running task.
I would say that it depends on the type of data you're saving. Sqlite is not always a bad idea. It's slower than storing an array in memory, but if you're handling a 500-entry address book an array is going to be a lot more clunky than a database.
Robospice looks interesting.

Categories

Resources