[Q] Best Option Database to integrate into app - Android Software Development

Looking for a bit of advice on databases integrated into an app, I have looked around and nothing seemed to answer my question. Will try make the problem clear and I hope someone can help me out.
I want to have a master database that is going to have a full list of information. In the app, the user will be able to choose from this list those which apply to them, leaving a smaller list. If the main database would be stored remotely I would think the user list would be stored locally to make any action on it quicker and so the app wont rely on an internet connection.
I am having trouble choosing what direction to go with the database and which will work best with Android. Also, from my research so far, I am on the fence as to whether the master database will be remotely or locally on the device. I would rather it be remotely so to minimize memory usage and have the means to set up a server system or other method to host the file. Seeing as the user list will be stored on their own device there is no need to store anything else apart from the master list and it being on a server will make updating it easier.
If anyone has any thoughts on what I am looking for or knows a best-of situation I would greatly appreciate it.

Related

[Q] database implementation

Creating a SQLite database for an android app, and I have a lot of data I need to import into this database. Any suggestions on the best way to do this? I have a couple of ideas, but some outside advice is always helpful.
Thank you
If it is a one time import, you just need to run a INSERT query at initial setup of database. The DATA to be imported itself can be hardcoded, downloaded, or in a textfile. If the initial data is never going to change on any install, then use a TextFile.

[Q] Newbie developing: How to host/share an SQLite Database online?

Hi!
I'm rather newbie developing for Android, and I'm kind of lost...but here goes what I'd like to do:
I'd like my app to have a local database that is updated from online, either downloading a new file each time versions don't match (which I find hard), or somehow to download/upload the latest insertions to an online file.
I'd like it to work somehow offline allowing to sync anytime that there's connection, so I'd like a local DB where the query is made, but I also want it to be synced as much as I can. Users should also be able to add new rows to the table, that could be done at any time the user decides to sync.
So...How can I implement an online database? And also, as a sidenote...Where could I host my DB? Is there any free hosting I could rely on? In my opinion it should be a rather small DB...
Thank you!

Best approach for loading website data into android app (without webview)?

Hi,
I am wondering what possible ways would be for loading a simple website into my app. My first thought is using a WebView, but I would like a dynamic app, while webview takes some time when loading between pages and links.
Is a common solution to load the html resources locally, from let say the assets folder? Than I could use AsyncTask to keep the files up to date and whenever the app starts it would load and work much quickly.
Or should I use HTTP Requests and parse the external Html document?
What would be the most situable solution for this kind of app?
Thanks,
Ved
vedtam said:
Hi,
I am wondering what possible ways would be for loading a simple website into my app. My first thought is using a WebView, but I would like a dynamic app, while webview takes some time when loading between pages and links.
Is a common solution to load the html resources locally, from let say the assets folder? Than I could use AsyncTask to keep the files up to date and whenever the app starts it would load and work much quickly.
Or should I use HTTP Requests and parse the external Html document?
What would be the most situable solution for this kind of app?
Thanks,
Ved
Click to expand...
Click to collapse
I think it's probably a decision best made by yourself. You have not said what type of data ? Cause really you should be wanting the minimal amount required. My app uses lots of data from my server for things like themes, but these come direct from SQL Database
deanwray said:
I think it's probably a decision best made by yourself. You have not said what type of data ? Cause really you should be wanting the minimal amount required. My app uses lots of data from my server for things like themes, but these come direct from SQL Database
Click to expand...
Click to collapse
Hi deanwray,
Thanks for your reply. I made some more researching and I have realised that my best bet is SQL, as you said.
Do you request data in your app directly from the online mySql database generally? I have read about a technique on downloading the data from the online database and converting it to SQLite (which is the local database on android) inside the application. This would be really cool, would really boost performance.
ved.
vedtam said:
Hi deanwray,
Thanks for your reply. I made some more researching and I have realised that my best bet is SQL, as you said.
Do you request data in your app directly from the online mySql database generally? I have read about a technique on downloading the data from the online database and converting it to SQLite (which is the local database on android) inside the application. This would be really cool, would really boost performance.
ved.
Click to expand...
Click to collapse
well my app uses a hosted database for
Online Theme Data (thumbnails store in just web space)
Settings Overrides (settings that I may have to force on the app)
Announcements ( Messages that trigger dialogs, adverts, html boxes)
Purchase info
other stuff that I forget
Any database that I access online I cache data local in cache sqlite database
So lets say the most complex things is the purchase list... a rough flow is as follows :
Get idents from online purchasable list
get descriptions and titles from idents
store local database
Simultaneous query of google IAP data from play to get locale info and pricing (along with IAP ident)
Store that in same local db
Display to user at, initial data, updated data and price additions
The database online is accessed via php (not a fan of that but hey ho, not really a programmer so there ya go) and given to the app as encoded JSON
I'm currently considering an ORM system like greenDAO or something like that...but not looked too much into it currently.
The themes database is quite good as it hold descriptions of views, shading, dimensions etc, these too are never displayed to the user from the server, but are cached local, cause failure of internet and failure of sync should not prevent any vital parts of what appears to be an offline app from working (e.g. my Smart SMS app)
Hope that helps, I could pass you the php although tis quite simple, there are security issues to look out for though
deanwray said:
well my app uses a hosted database for
Online Theme Data (thumbnails store in just web space)
Settings Overrides (settings that I may have to force on the app)
Announcements ( Messages that trigger dialogs, adverts, html boxes)
Purchase info
other stuff that I forget
Any database that I access online I cache data local in cache sqlite database
So lets say the most complex things is the purchase list... a rough flow is as follows :
Get idents from online purchasable list
get descriptions and titles from idents
store local database
Simultaneous query of google IAP data from play to get locale info and pricing (along with IAP ident)
Store that in same local db
Display to user at, initial data, updated data and price additions
The database online is accessed via php (not a fan of that but hey ho, not really a programmer so there ya go) and given to the app as encoded JSON
I'm currently considering an ORM system like greenDAO or something like that...but not looked too much into it currently.
The themes database is quite good as it hold descriptions of views, shading, dimensions etc, these too are never displayed to the user from the server, but are cached local, cause failure of internet and failure of sync should not prevent any vital parts of what appears to be an offline app from working (e.g. my Smart SMS app)
Hope that helps, I could pass you the php although tis quite simple, there are security issues to look out for though
Click to expand...
Click to collapse
Thanks for the details! It was really useful to see your workflow, I was not sure about the direction I should choose for my app development, but now is much clearer.
Thanks!
ved
Hy deanwray,
I could use a litle help, regarding the methods you have adopted for synchronising your online database with your apps local database.
I have reached a point where my database is ready, I am parsing (via JSON) data from a local xml file, and inserting it into my SQLite database. Everything works ok, but I need to get the data from my online mySql server into my app on a regular basis.
I have found threads wich mentiones the Android sync adapter, and others where people use the HTTPClient to pass data to/from the server. To be hones I am a bit confused, I would really glad if you could light me up on what would be the best approach, or what works for you the best
Thanks!!
vedtam said:
Hy deanwray,
I could use a litle help, regarding the methods you have adopted for synchronising your online database with your apps local database.
I have reached a point where my database is ready, I am parsing (via JSON) data from a local xml file, and inserting it into my SQLite database. Everything works ok, but I need to get the data from my online mySql server into my app on a regular basis.
I have found threads wich mentiones the Android sync adapter, and others where people use the HTTPClient to pass data to/from the server. To be hones I am a bit confused, I would really glad if you could light me up on what would be the best approach, or what works for you the best
Thanks!!
Click to expand...
Click to collapse
If you want do operate online database server then generally php is used.there is a tutorial on androidhive check it . you will get the answer
Sent from my GT-S5570 using XDA Premium 4 mobile app
vedtam said:
Hy deanwray,
I could use a litle help, regarding the methods you have adopted for synchronising your online database with your apps local database.
I have reached a point where my database is ready, I am parsing (via JSON) data from a local xml file, and inserting it into my SQLite database. Everything works ok, but I need to get the data from my online mySql server into my app on a regular basis.
I have found threads wich mentiones the Android sync adapter, and others where people use the HTTPClient to pass data to/from the server. To be hones I am a bit confused, I would really glad if you could light me up on what would be the best approach, or what works for you the best
Thanks!!
Click to expand...
Click to collapse
if you need a real time chat hit me up on hangouts https://plus.google.com/+DeanWray/

[Q] Encapsulate AccountManager

Hi guys,
I am trying to encapsulate the AccountManager. Specifications: Be able to retrieve an ApiToken (easy one, just use getAuthToken()), be able to create a new account (another easy one, just use addAccount()) and be able to chose from multiple accounts. I am not able to find a solution for the last point. Choosing itself is not hard. Just make an own Activity or use the AccountPicker.
The problem is I can want to encapsulate this in a simple POJO, but the AccountPicker needs an activity to be started. Now you may say, just pass the current visible Activity to the POJO. Well here's another thing I want to be able to do: Keep a reference to the selected account, so the user does not have to select the correct account everytime the app tries to retrieve an API-token as this account should be passed to getAuthToken. So passing the current Activity does not really solve this issue.
Any ideas or links to solving this problem or to a better approach on this topic? I am a fairly new developer and find it hard to find tutorials/best practices on Android Application Programming Patterns, so I'd appriciate some links.
Best Regards,
SampleAndroidDeveloper

[Q] How to Find/Delete all data create by App?

Hi Guys (and Girls),
I'm trying to help a friend with a specific problem. She has an account (Badoo) which was blocked by Badoo; a friend used her account and abused it, and the result is that her account is blocked. Badoo refuses to unblock it. Even worse, when she creates a new account it is also blocked almost immediately, effectively making it impossible for her to use Badoo.
So, I try to help her with this - also because I like the technical challenge here. I've found out that if I create a new account, it stays active; but the moments she starts using it, it is blocked quite rapidly. Reason: they recognise her from before. It is not related to userid, name, email adress or any of the data uploaded. So, my only conclusion is that there must be *something* on her phone that is found; and the help file they have online suggest they install 'persistant tracking cookies' on mobiles.
Uninstalling the App does not work. So, there must be SOME files somewhere that are NOT deleted after uninstalling; and the moment you reinstall, they are found and the account is blocked (at least, that is my reasoning).
I've tried writing a small App to find something, but cannot find any way to do this. The way I understand it, all files created on Android should be linked to the App (so should have owner/groupid linked to the App). I therefore think it should be possible to find any files installed by an App, and just remove them. I was afraid they would be in the /data/data/... folder, but it looks like that folder is cleaned after uninstalling, so they are probably somewhere on the SD-card.
I expect a wipe of the phone will sort everything out, but unfortunately that is not an option.
Anybody has any idea how to proceed with this?
I would be interested to know the answer to this also!

Categories

Resources