Sync data set from Desktop PC to several Android Tablets - android

I want to be able to sync a "master" data set from a desktop machine to several tablets. I cannot guarentee all devices will be available at the point the data changes so I need the tablets to update when the data set is updated.
The data set sits in a folder on the desktop, its just a bunch of PDF files and a few txt files, nothing special.
At one end of the scale I guess I could run a script that just copies the folder over to the tablet, data updated or not via USB mount. Not really the way I want to go, I want something a bit more slick.
I guess i could call ADB from within a desktop JAVA app to push the files across, although this seems like it might be difficult if several devices want to update their local data set at one time.
Finally, I was wondering about something like OpenMobster (https://code.google.com/p/openmobster/) but I am new to this and it seems fairly complicated, is it worth the complication?
Are there any other options I am missing? I plan on using a Linux based Sync PC if that makes any difference at all? The final restriction I want to cover is that none of this can be connected to the Internet so Dropbox etc are non starters. They were my first thought but sadly no go.
Thanks for the help, I know this is fairly general, but I need a push in the right direction to start more research.

Something like this should do the job:
https://play.google.com/store/apps/details?id=org.pcfilesync&hl=en
Maybe this question is better located at superuser.com?

Related

Android apps losing files

I'm looking for someone who might be able to suggest ANYTHING that might explain this problem I've been having. I've been having this problem for almost three years, with the same app, and nothing I have tried fixes it, or even explains what's going on. The app is a little game, and it saves its state in three files inside one level of folder, like so:
USERNAME
gamestate1.dat
gameinfo.dat
gamestuff.cfg
So what happens is, people will play the game, then suddenly the next day they'll play it again and data will be wiped. Sometimes all files (and the folder) are gone. Sometimes one or two files are missing. It's not common,but it's happening enough that it's occupying too much support time.
The game itself has nothing in it that deletes files at all. The game doesn't delete. But the files are vanishing somehow anyway. The game is not a hardcore game for hardcore players, so most of my users are tech-ignorant, so I know they're not going in an deleting the files.
The rate of customers complaining that they've lost everything increases exponentially right after I push an update.
Can anyone tell me if there's ANY kind of special situation on android that could cause this, and how I could prevent it? Is some antivirus on some phones? Could it be sectors on the card going bad? I've tried turning Google sync on and off and every which way, and turning sync off seems to reduce the problem without eliminating it.
I'm using JNI and accessing my files with normal C++ file functions-- fopen, fwrite, fread, fclose. I am saving them in the folder returned via getExternalFilesDir(null).getAbsolutePath().

Site parsing and opening with slow internet connection

I am making a network app that works with a few news sites. I have an option to view and download articles (for reading in future). There is no fast mobile internet in my country (mostly 2G with the speed up to 15 KB/sec) and my app doesn't work really well with the slow connect though it's perfect with fast connection. As I have seen from logs it can't establish the connection. When I try to open the article it doesn't load at all or goes into infinite loading. When I try to save the article it simply saves the blank file. How can I track these mistakes and catch them? And what are the correct ways of handling it?
I suppose that my code is irrelevant as it works correctly with Wi-fi. I think I simply need to add lines, not to edit them
ok, you need to manage the information very good, you need define the package size to download, you need a webservices that allow to you to manage the information one by one, for example you need design packages no more than 500kb size to download, when this package is downloaded you can show something in your mobile and continue downloading the next package in background.
500kb is only an example you need to test what is the maximum data size to download and create packages like that in your web services

Postgresql Server on a Tablet?

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.

Android App to talk to a web server, download a file and parse

I am new to this. I have the Android SDK installed with Eclipse. I can work with basic activities and layouts.
I am looking to write this Android application that will;
1) Allow users to sign-in using a pre-allocated password.
2) Login and change the password.
3) Every time the user opens the app, he downloads a CSV file from a server to the SD card.
4) The app parses from the file and displays them on several activities and small frames inside the app.
Think of it as an informational application. But, I'd like to add some intelligence on top of it after I get this done.
I have read many articles and topics but none of them give me a specific approach to do this faster. I have very little time for development.
If there's a similar application that you're familiar with, I'd like to take a look at the code.
I want to know exactly (the code) on how the communication between the app and a linux based server on the web needs to be established. Right now, there's only a CSV file (or an EXCEL file - which one's better to parse? How to decide?) there.
Also, when the CSV file is up to date, I wouldn't want it to download the file again. How to prevent it?
As I said, I am new - so please be patient.
Thanks
If you are new to this and want to develop something fast, why do it the hardest way, in java? There are so many easy toolkits out there, e.g. RFO.Basic, you will be amazed how much you can achieve, fast, that way.
(You asked several questions) Easiest to parse? If you don't have Excel installed on your Android device, the CSV is of course easier to parse, needing only text tools. However, if you have a choice of formats, why not use XML? If you have never worked with XML, there is a little learning curve, but there are lots of tutorials on the web. After that, you'll never want to go back to CSV.
Your last question: how to prevent download of unchanged file? Is this about a big file? In that case start with quickly downloading the hash (checksum) of the file, so that the client can decide if the file has changed.

data transfer from mobile app to computer

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

Categories

Resources