SQLite-sync Sync Framework in Android app - android

I am working on a project which can sync SQLite on Android app with MySQL on server. At first, my approach is:
-Create a periodic sync service to sync to MySQL via Restful API
-Sync algorithm: http://havrl.blogspot.ie/2013/08/synchronization-algorithm-for.html
-Using Retrofit lib: REST client for Android app.
But I am new to Android and I find it quite difficult to implement this approach. I found another solution: SQLite-sync Synchronization Framework - http://wiki.sqlite-sync.com/projects/sqlite-sync-com-synchronization-tool
This framework is based on Sencha Touch but my project is a native app.
-1: Is there any approaches to use this framework on my project smoothly with the existed SQLite database?
-2: If not, I have to develop sync module from scratch. Is my first approach OK ?
In additional, I have an OCR function on my project which recognize 7-segment number on 7 segment LCD panel using OpenCV. It recognizes well in virtual environment (black-white PC screen) but in actual environment (blood glucose monitor), it doesn't, because of contrast ratio, I thought. So, how can I improve quality of OpenCV 7-segment number recognition ? (contrast,etc) I have no idea of what to do.

you can go by the Sync algorithm you have mentioned in the link - http://havrl.blogspot.ie/2013/08/synchronization-algorithm-for.html
Use Rest APIs within Android sync adapter concept. Highly recommended as it has lot many advantages. Lot of plumbing code can be avoided

Related

Portable Mobile/Tablet application proof of concept

I need to develop a portable application mainly for Windows 8.1 and iPad, but could be expanded for Android, WP and iOS later.
The application consists of calling web services to display data in grids and it contains CRUD operation, and it may save some local data for offline mode then synchronizes later when connectivity is up.
I'm torn between too many solutions, I need your advise for better solution.
1- Solution 1: Go Native for each OS (VS for Windows 8.1 [RT and pro] and xCode for iPad): this solution requires code duplication, logic and UI.
2- HTML5 with WebView app: I think this is a weak solution especially that we have local storage, checking for connectivity and calling ws ...
3- Using Xamarin: I think Xamarin does not support WinRT or Windows 8.1 to share logic code between iPad and Windows 8.1
4- Using Xamarin.Forms: Building the UI is tough and also it does not support Windows 8.1.
From your perspective, what is the best solution? please advices if you have any other proof of concept.
Many Thanks.
Most of the html/hibrid frameworks like Cordova (cordova.apache.org), Ionic (http://ionicframework.com/), etc, uses a native WebView on Android. Until Kitkat the performance of WebView is not production-ready and if you've a list with a lot of elements, the scroll experience is really bad.
If you want to do a simple proof of concept, prototype or whatever, I think that html frameworks are a good alternative. But if you are going to put your bussiness on top of one of this framworks, I would not recommend.
There is an alternative to embed a Chrome using Cordova & crosswalk (https://crosswalk-project.org/documentation/cordova.html) but you will end with an APK ~40Mb for a simple hello world.
Just my 2 cents. I don't see a point in using libraries that are unsupported across the platforms you plan to release and support on. Personally, I'd code natively for each platform. While this takes a lot of work, if you have to ask for direction on which path you want to take your application, then this type of project sounds more like a "you reap what you sow" application. Also, you'll be able to directly support each problem without having to wait for patches, but there are 2 sides to that coin as well. Your opportunity cost is missing future features the library will provide, if it's worth it to you.
If you aim at quality, going native is the only way... You can reduce the amount of work like Google is doing: writing the business logic and unit tests in Java, then converting it to ObjC with J2ObjC and to Javascript with GWT.
In your case, being that Java is a dumbed-down version of C#, you can easily find tools to convert to the latter, finding yourself with native business logic for every platform! That should account for 50%-70% of the codebase...
I think going with HTML5 with webapp view is better option.
Using Cordova (Phonegap) most of the native features are easily achievable in HTML webapp.
PhoneGap Platform Guide
Alot of other plugins are available for the advances features like BLE, NFC.
Calling webservice is really not an issue in HTML5.
Simple ajax is enough, however now a days many advanced frameworks are available which makes your work easy. One of the best among them is Angular JS(maintained by Google ).
Angular JS
For database you can access native database of the target OS or SQLite db of the mobile device.
You can check this link
Storage options
So developing a webapp can be a more efficient solution in your case. It can be best way for you as per my view point. However, you can do some R & D and can find the appropriate for you.

Using sklearn in android device

I am currently using sklearn doing machine learning for the sensor data I collected from an android device.
But the thing is I need to do predictions after the model is trained. Since there will be lots of sensor data generated in a very short time, doing predicting in a server or some other machine is my last choice.
Then it comes to me that is there a way I could do sklearn in android? I could think of three solutions:
Is it possible to run sklearn in android and just let the sklearn script to do the prediction?
If not 1, is it possible for me to use some intermediate library in java (android) to pick up the model I trained in python?
If not 1 and 2, is it possible for me to use some other machine learning library that is supported in the android platform?
I work on a project that called sklearn-porter which ports trained models to a low level programming language like C, Java and JavaScript. More classifiers and regressors will be added at given time.

C# web application to be transformed with Mono for Android

I have a c# web application and i want to build an android app using Mono for Android.
Is there any automatic way to use the existing code of my web application or i have to program everything from scratch using the Mono and the android application logic?
Thank
Stav
Hard question to answer, because it is very vague. However you should be able to take most of your Business Logic and drop it into Mono for Android without much hassle. Not really knowing how your Web App is structured it is hard to say how much of it you can reuse.
But I've made an App at work, which started as a Silverlight Web App, where practically all the model code could be reused, with one minor correction, which was to use HttpWebRequest instead of HttpClient and some minor corrections to the code to make the UI update correctly and make the updates run on the UI Thread.
The way I took to get the model code into my App, was to link all the necessary files into my project, and they mostly worked. Is there an automagic way to do this? I haven't seen one as of yet. There are some extensions to Visual Studio which can help you with linking files into your project such as Project Linker.

Using an SQL query builder library/framework with Android

I am currently working on an Android project and will have to manage database connection and queries to store data. I will not be working with SQLite as provided by the Android device and using it is not an option.
As I need to build quite a lot of queries I wanted to use a library or framework to make the task easier. Looking at what was available, it seemed easiest to use a framework such as, for example, QueryDSL.
However, since I am working on Android, I am not sure if the framework is usable and what using it would entail. Does somebody have experience using an external database with Android and have any recommendations?
The recommended way to connect to an external database is to use a REST client.
See this post

Right tools for GUI windows program

I will start a project ( not commercial, just for learning ) but I would like to choose to work with the right tools as I would if I were doing it for a company.
First of all small description of what I will need.
It would be a server-client(s) application.
For the server:
- GUI for Windows
- ORM
- Database without installation (sqlite ???)
- GUI builder (RAD Tool)
- Ability to create easily REST Services
Clients would be android devices
- GUI for android mobile
Clients would connect to the server and get some initial settings and then start to
send information to the server.
Server should be able to display properly the information collected from the clients and
edit them if needed.
Open source technologies are mandatatory.
First I am thinking to use sqlite ( I should not make any installation except the programm). Any alternatives here?
For the server maybe python with a gui library and sql alchemy. What about Camelot?
And for the clients (android) java. I think there are no other options here.
Can you make some comments on the above choices?
Maybe you can suggest something different which will make the development faster...
And for the clients (android) java. I think there are no other options here.
I'm no expert in the area, but below are some possible alternatilves for you:
C#: Mono for Droid (with MonoDevelop?)
http://monodevelop.com/Download/Mono_For_Android
https://stackoverflow.com/questions/tagged/monodroid?sort=votes
JavaScript: Titanium Appcelerator
https://wiki.appcelerator.org/display/guides/Home
https://stackoverflow.com/questions/tagged/appcelerator?sort=votes
Python: Kivy
http://kivy.org/docs/guide/quickstart.html#quickstart
https://stackoverflow.com/questions/tagged/android+python?sort=votes
For negative opinions on using such rapid-development frameworks, see, eg.
Appcelerator vs Android SDK
Of course such problems are not particular to the above frameworks... We couldn't rename a file atomically on Windows until the arrival of JDK7 which finally allows us to use MoveFileEx() (cf. Reliable File.renameTo() alternative on Windows? ). But you should always be careful on how to find an escape hatch :-)
As you have asserted: client is java only.
On server:
GUI for Windows : WPF
ORM - Database without installation : SQLCE 4.0 - Maybe use codefirst
GUI builder (RAD Tool) : Visual Studio lets you do that for WPF apps
Ability to create easily REST Services : Use WCF
hope that helps

Categories

Resources