share database between desktop and android app - android

I´m creating a simple database, let´s say something like NBA players with statistics and pictures. I want to be able to edit the database in my desktop C# application and then consult it on my phone .. When there is no internet!
it is Ok to transfer files from desktop to phone manually. It is Ok to download in the app and then get to the place where there is no internet.
The question is .. what´s my best option here? one big xml? or json? a one-file database like sqllite?
I have expertise on C# but I´m new to android and the whole internet connectivity thing. So I´m specially interested on something that´s easily accesible from android phone.
What would you do ?

In my opinion, it is better that you use a single database for the 2 application using mySQL, a local network is necessary, but an internet will be optional. Android will Send & Retrieve Data in the database. Here are some links you can use( documentation, sample codes ).

Related

How to show images in offline tablet application

I'm looking for a way to create offline order entry application for Android and Apple tablets.
Application should download product list with images.
It should allow to show large product image and allow to enter ordered quantities for products.
This order entry must work also if there is no internet connection.
If internet becomes available, entered order should submitted to server.
I looked into offline Web application sample in
http://diveintohtml5.info/offline.html
and searched sourceforge and codeplex for reference applications but haven't found any.
Most difficult seems to be showing offline images. In html5 application I found two possibilities:
Store images in Indexeddb (or in other way) and use javascript to show images
in tablet browser in offline mode.
Where to find sample for this? To to convert database data to image which is displayed in tablet ?
Create manifest containing all image urls dynamically. Tablet browser probably then loads images into offline cache and allows to show them in offline mode.
Where to find framework or sample application which can be used as starting point ?
Should I use html5 + Indexeddb + jQuery + jQuery UI or is there better way ?
Server is Linux server running C# Mono ASP.NET MVC4 application which can provide data for this planned tablet offline application and receives orders from it. I can create WebAPI controller for application.
You need to persist the images in your application and control the references using a database (search for core data for iOS and greendao for Android). Anyway you will need a mechanism to download those images from server when internet connection is available to store that.
About the orders, you can store the order locally in your database and when internet is available you sync those informations with the server, that mechanism can be called whenever you want, you need to define how will be user experience.
My suggestion: Try to break your problem in small problems and try to resolve them. Your question looks more like a general architecture question.
Here is the topics that can help you to develop these apps:
Android:
Database: greendao:
http://greendao-orm.com/
Webservice/Persistence: https://github.com/koush/ion
iOS:
Database: Core Data: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html
Webservice/Persistence: https://github.com/AFNetworking/AFNetworking
I hope this help you to start.

Is there a way to change the default SQLITE database location on an android phone, to a folder on an HPH website?

I have an app that stores a sqlite database in the usual place. ie: data/data/com.blah.blah/databases. I wish to remotely locate the SQLITE database and read from and write to it. I wonder if there is a way to do it without using the Oracle Mysql option. Is there a way to just change the default location to a folder on a website. Thanks in advance. If so how do I do it. I cant find any tuts or books that explain how its done.
SQLite isn't a remote database implementation. That is kind-of part-of white it is called SQ*Lite*. :) It is for doing SQL databases based on local files, without taking the big additional overhead of having some remoteable service protocol sitting between you and the database.
There are all kinds of options for interacting with remote data stores, not just MySQL - PostgreSQL, etc. You can use whatever of those you want. You can then have on the device just the client code you need to communicate with the remote data store. It doesn't make sense for Android to supply any complicated/sophisticated here built-in, though, since exactly what you want is going to depend mostly on what you are using on your back-end server.

which kind of database to use with android app?

I am developing an android program for my university. I am confused about which database to use.
What I want is that when the user is connected to the internet the program will check for any updates in the backend database. If there is any, the program will sync it with Android device.
Let's assume that after while the user opens the program in place with no internet, the program will work just fine because the file is already in his mobile.
I chose Access and created .xml file and by the help of this site: XML resources in android. I learnt how to read it.
Actually this program is my senior project. I dont want the judges to ask me why didn't I use MySQL or SQLite.
Which database system should I use? Is Access the right database system to choose?
I want to do a program that looks just like Univ of Kent program.
Parsing XML could take time, also in XML you have no choice but to load the whole file.
SQLite is fast, simple to use and very dynamic.
Android offers a very simple SQLite API. Androoid SQLite API
If you are interested in reading more about all the data storage types in Android visit this link
It depends upon your requirement. lets say you want to build something which handles and stores the data on your device locally then SQLite is a good option (you can use firebase as well).if you want to do some sort of calculation on you data on a remote server then firebase is a best choice .
by using firebase you can store your data generated by your users and then if you want you can carry out some analytics as well.
i would prefer Firebase .

How i connect MySql in android

I am trying to connect mysql in android, but I can't. Are there any alternate ways to developed application without mysql if there is small database needed. And which one is better to use mysql or sqlite and why?
You basically give the answer yourself: android has Sqlite built in, so if you need a DB in your app, you have to use SQLite.
The good thing is that it is small (and built in), so that it won't use much of the (limited) memory present on a mobile device.
You build a rest web service and then use http:// to push to that from your droid.
If you have to use the database in a scenario where your data comes from the Internet, then you would be using MySQL (or anything similar, like MSSQL) and will be developing web-services in PHP, or JSP or anything like that, to make your database available to your app.
If you have to use the database locally, you use SQLite
depends on the scenario.
For SQLite, refer this

Android Remote Database

I'm in the process of developing an Android application that will need to connect to a central database. Users should be able to access records and add records to the database through the application. The data itself will be fairly simple with each record being made up of a number of text fields.
The database will be developed specifically for the application and only needs to be accessed through the application. Initial reading seems to indicate that a web service should be written to parse data into xml format, for use by the app.
Seen as the database is being developed from scratch, specifically for this purpose, I would like to make sure I am heading in the right direction. I have very little experience with databases and would really just like a pointer on where to start reading. Any suggestions on the format the database should take would be greatly recieved too.
Thank you
You seem to have the idea down, if it were me, I would recomend using JSON instead of XML for the Webservice, they work in very similar ways, but JSON is a lot smaller and will make the application noticeably (as in it will make a diference for the user) faster. This is specially true if you are sending large amounts of data.
Take a look at this:
GSon
If your familiar with other aspects of Java, you could make the implementation entirely server side by means of JSPs. You could access the database via the phone's browser or any other browser. If you implemented a DAO factory on the server, this would enable you to switch databases from say Oracle, to MySQL etc by means of a properties file.

Categories

Resources