I am working on a simple program that collects data from the field on an android app and stores it in a database. The next step for me is to be able to take the data from the collected and transfer it to a programming running on a computer. I am looking for best suggestions on this. One aspect of my field data collection is that I want it to be scale-able, right now it is only for android, but in the future I would like an apple version. I have looked at tethering and transferring data over USB, however from what I have read android has issues with that, and I am not sure how easy it is for an apple product. The other option that I have found is using a dedicated web server. Download from the mobile app and then upload to the computer program.
Is one option better then another, have I missed an option?
Don't sync your database to a computer. Instead, sync it to the cloud using something like Google App Engine. The APIs are easier, and the result is more useful besides.
If you ensure that adb is installed on the host computer, then you can just use batch scripts to grab the necessary data from the android device.
For example, have your android app save its data on the sdcard in a file called fielddata.txt
Then you can have a script:
adb pull /sdcard/fielddata.txt fielddata.txt
Related
Not a super technical person here (just T-SQL programmer). I'm writing a original novel for and like to put as much realism as possible based on current real technology.
Can Operating systems whether personal computers or mobile devices able to read the type of data being uploaded by a third party application to the cloud or via bluetooth? If so how is it done the background behind it? what if the upload is encrypted (E2E)?
Thanks!
An OS can see the data while it’s just a variable in the app (way before it is encrypted and sent). If the app can see it, the OS can.
Also, you call OS functions to send things over the Internet, so it can see it then as well. And, you typically encrypt using OS functions as well.
But, even if you encrypt with your own code, at some point you need to decrypt and use the data, and the OS can see all of your memory.
I am currently working on a (commercial) logistics project. We build a (partially) automated storage system in which the goods are stored randomly (think of nano-amazon). The positions of the objects are stored on the main computer and we are at the moment implementing the offsite backup via WAL (any objections?). One of our problems is that we have to operate during a power blackout and we can't produce enough energy for our computers for the worst case duration of the blackout which could be several hours. [This probably will never happen as we are in Germany, but there are some regulations we need to fulfill].
So my idea is to use a tablet [cheaper than a laptop], send the WAL-files to it so that the user can access the data during the blackout. But so far, I have seen no server implementation for tablets (either android or ios). Isn't there any or did I just not find it?
But maybe I'm also moving into the wrong direction. The Database is rather small (<50000 objects in the warehouse with each < 1kb) and the information we need during blackout is just one table (object_id -> position_in_warehouse) so that I even think about writing this information into a file and using git to copy the changes to the tablet. We also only need to know which objects have been removed during the blackout so that this information can easily be migrated back to the original db.
Or do you have other ideas?
Does your time have any value to you? Discard the Android + PostgreSQL option right now.
Keep it simple. You can get a cheap laptop for practically nothing, especially second hand. Since you clearly don't care about it actually working as a backup option, that seems like a no-brainer. You can run a streaming replica with WAL archiving for fallback.
For your real fallback option, you're on the right track with writing out the data you require to a flat file and syncing just that. Remember to actually test it - you should actually use it occasionally and make sure it works.
BTW, for your WAL-streaming backups, I suggest PgBarman, which will manage retention and rotation for you. You should also do logical dumps, and remember to test your backups.
I don't think there's a port of Postgres to Android - to use WAL files you'd need a working server. Even if it was ported, then you can't ship WAL files from x86 server to Android tablet - master and slave have to be the same major version, OS and architecture.
You really should just periodically export your data from Postgres to a simple file (I'd recommend SQLite) and just download it from a server. I suppose your tablets use WiFi and this file would be like 10MB zip-compressed.
Alternatively you could use rsync to keep this file updated. Don't use git - it will keep all previous versions of this file on your tablet - it would grow rather fast.
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.
I'm trying to extract contact informations from android devices and synchronize it with the addressbook in osx. Basically a direct synchronization mechanism from device to device without the use of a necessary google account. So far I managed to run a socket server on the osx side and publish its service via bonjour which can be discovered and contacted from the android phone. I'm also using a syncadapter on the android side to provide the synchronization functionality.
So far the setup and the idea, my question is now, what would be the best choice in terms of data storage and communication?
On android, contacts are stored within a sqlite database, which can be queried. (Actually three tables to get the full set of informations Contacts.Contract.Data ..RawContacts and ..Contacts) The addressbook can be easily accessed via AddressBook.framework. I'm very unsure about how to get a common data structure to synchronize efficient and reliable. Is it a better choice to work on the sqlite database, or take a vCard as a common data object to sync on or is it better to do convert the android data into core data objects and sync on them? Tipps and comments are much appreciated. Maybe I'm also thinking way too complicated...
The vCard format was designed as a way to transport contacts so it should be able to work. It seems to me, though, that unless the OS X and Android SDKs provide an easy way to work with vCard that it would be easier to define your own XML format.
I want to debug database on android device. My application is very heavy and I do too much insertion queries and other stuff so running on emulator is hell slow so I am debugging it on Android phone.
But I could not debug database, like in Iphone you can see even insertion made into database. I want to see the current situation of database without rooting my phone and pulling it from my phone and then opening it into some 3rd party software.
Is there any way to debug Android database on mobile phones without rooting and pulling database out?
There is tool sqlite3 but the problem is that when you connect to shell it shows you ugly data and furthermore if database is not created running any query actually creates database in database folder so you would never knew that your database was not created by your logic.
I hope you understand what I am looking for.
I had the very same problem and after a search I found this one SQLiteManager plugin for Eclipse which is a plugin for eclipse allowing you to see and browse your data strait from SQLite DB
To use this it's easy, start you emulator, browse the emulator files in the DDMS view then
go to data > data > com.your.package > databases > your_database_name.db (note the db extension is mandatory)
and a new tab will appear with your data!
It won't work on a real device (maybe on a rooted one?)
Hope it will work for you :)
There is information on how to connect eclipse to a sqlite database here. Another alternative is using this Firefox add-on to manage your sqlite database.
I'm still looking into it myself but there is MOTODEV Studio for Android, requires free registration.
See the next simple, single JAR file.
on google code