I'm planning a mobile app, to be built using phonegap, that will sync user data with a server. The data can be edited on the app or via a web interface on the server, and some users will have multiple devices so need to sync to them all.
Anyone know of good guidelines/tutorials/patterns for this sort of thing? I can hand-code it all but I'm sure I'll make lots of common mistakes and it'd be better to either use a library or follow some good rules.
If I was doing the server in java then something like OpenMobster sounds good.
have you checked out the Sync Framework Toolkit?
I am looking to do the same thing and have found https://github.com/orbitaloop/WebSqlSync/. I have not used it in anger yet, but it looks good.
Just so that there is no stone left unturned in your research.
To use OpenMobster your server does not have to be in Java. It helps if it is, but you can have your server in any language or platform. All you have to do is expose your data via a secure REST API.
You then write the OpenMobster Sync Channel that accesses data via this REST interface. Yes, this Sync Channel has to be written in Java as it plugs into the core Sync Engine.
So architecturally speaking, you would have the OpenMobster server between your server and the mobile device.
This is the same architecture when mobilizing legacy databases, CRM systems, ERP servers, SalesForce.com, etc
Full Disclosure: I am the Chief Engineer of OpenMobster project
Related
I want to develop an android app that is based on server-client system. I want to develop both backend and android client. It's 2020 and there has already many frameworks developed to provide server side missions to programs.
My question is
What are the trending backend technologies in android world (from database to REST API frameworks), with reasons? For now, I have 2 framework/library on my mind. Spring and Node.js. Google Firebase are also in that list.
I also have another question
Suppose that I made a backend project and want to deploy it on a real server (development made on localhost). What choices should be made ?
For example, I made my development on Mysql and Springboot framework, should that server provide support for MySql and Java ? What is the procedure to deploy both database and backend application ?
Thanks.
You can develop web server using ExpressJs in Node, or using Django/Flask in Python, using golang, PHP Laravel or Codeignitor and many more. It all depends on which language you're already familiar with and which is the best for your use case. Frontend framework has very less to nothing to do with which back end to chose.
Answer to second question.
You can deploy your app in AWS, DigitalOcean, GCP etc. They'll provide VPS and other options to host your application and will make it accessible to outer world using IP or domain, however you configure it. You can install and self manage the DBs in the virtual system you have or you can use Managed database solutions provided by cloud platform, which has a pricing but is easier to manage.
PS: Both your questions were very broad and more of a opinion based answerable questions, it's better to ask these type of questions in platforms like Quora where you can get very detailed answers. Anyways, good luck with your project :)
I have worked on these three stacks
1) React-Native Express API MongoDb
2) React-Native Firebase
3) React_native Django
If you are comfortable with python and planning to create a large scale product, Django Backend could be a way to go. React_native Firebase is perfect for fast prototyping. If you are using a platform where you need to do heavy db query search, firebase data storage can be a poor choice.
I am an Android developer and I want to make an app which shows users on a map and performs tasks based on their location.
The whole model of the app has to run in the server. I need an API which:
Receives user location
Performs calculations based on the location of the users
Sends response to specific users with the results
The problem is that I have 0 experience in doing server side programming.
Can you please suggest me a way of making the server?
I checked the Google Colud Platform and this video. The video addresses the connection between the app and the server, but what I really need is coding the model and deploying it on the cloud.
What is the way for me to build the API for such an app, as a developer with no server side programming experience?
Can you suggest me a tutorial which goes trough the process of building a cloud backend for a mobile app?
This is a very complex question. I don't recommend using a "ready-made" solution like FireBase because it's even harder to transform it into a "proper" API later on when you need it. If you know Android then you know Java, you'll have no problem learning working with a framework like Spring Framework which I recommend. Java on the backend needs a Java Servlet container, like Tomcat. First you should set up a development environment on your machine for this. I recommend searching for Spring Framework tutorials for this i.e. Spring Framework REST tutorials.
Secondly you'll need a database like MySql or MongoDB to store data. Spring comes with ready made connections to most of the most common databases, so its pretty easy to work with them.
When you're ready to deploy your service I recommend using a PAAS like Heroku.com where you can run your service for free first. In this way you get to control everything yourself and you also learn a useful skill.
Since you are coming from the JAVA background you just need some basic building blocks and you shall be good to go.
Use PASS: They will take any devops from your side which will be a big relief considering you are not familiar with anything on server side. I recommend using Heroku or App Engine. Here's guide to App Engine with JAVA on top. https://cloud.google.com/appengine/docs/java/
Database: Not sure how you are storing and managing your user data as of now, but if you need database, there are various of those available now. The reason Firebase is top suggestion, cause it leverages realtime and gives you control on your side without spending a lot of time on your side.
APIs: You will be taking user's geo-location and sending it to server. On server you will need to process that into a real world location and any other logic. You will need to use Google's GeoLocation and reverse geocoding APIs for that. Find apis here : https://console.cloud.google.com/apis/
Also if it's any help, App Engine and Heroku both offer free limits and should be pretty sufficient for your use case.
Since you have limited experience on server side development I'd suggest using a backend-as-a-service platform. This approach has the benefits of allowing you to focus your time coding the client where your competitive differentiators are, and lets you leverage years of experience in server-side development without having to ramp up on the technology. It also means you can iterate quickly and test features ideas with less risk.
There are several options out there, but in your case, you'll need something that provides enough flexibility to implement custom logic and a custom data model. Some platforms allow you to create a full backend application with REST api endpoints, and automatically take care of deployment, security and management. Some examples of backend service providers can be found here https://en.wikipedia.org/wiki/Mobile_backend_as_a_service.
Some of the platforms actually allow you to build a full custom app without actually writing any code, and some of them provide ready-made components (like chat, leaderboards etc) but are less flexible.
Here's a list of Backend-as-a-service providers:
https://quickblox.com/
https://www.appcelerator.com/
http://www.configure.it/
https://cloudboost.io/
http://api.shephertz.com/
https://backendless.com/
http://pipegears.com (No coding required)
You didn't provide specific details about the tasks you want to implement on the backend, but it's likely that you could satisfy your requirements with a straightforward REST api that accepts your location data, runs business logic, reads or writes from your data model and returns whatever data your client needs. (Sorry I can't get more specific without details on your requirements). If you're dealing in sensitive information like location data, I'd strongly recommend securing the api with TLS/SSL (i.e. https), or make sure the platform you use provides this.
I'm currently developing an android application. My application allows users to choose a picture from a gallery, add a comment and send it to the server. The server then saves it in database.
Currently I'm using HttpUrlConnection at client side and Dynamic Web Project with a servlet to process on server (I'm using eclipse with Apache Tomcat)
So the questions are:
Is it a proper use of this technology to develop my app. (does it violate any rules? Sorry I'm a newbie)
Does this technology affect anything if i want to expand my app?
Are there any better technologies to use in this situation and is it worth to use it?
No I think it is a better way to develop this. I have also develop a chat based app usign the same technologies.
It doesn't violate any rules. There are many apps in the market usign the same technologies.
Q-3.Are there any better technologies to use in this situation and is it worth to use it?
You can also use php or any other server side scripting language to do the same.
Because when you want to host your java app you may find difficulty for java hosting but for php and asp you can easily find hosting services.
I answer in order:
1- the client is different, the client is recomended create an android application.
2-You need have clear this: Android is an application, the server has to attend petition from android. The conection could be using webservices, API rest, or others ways.
3-Android need Java to be native, in the server side you can use, Ruby, PHP, Java, Python or any server programming languaje side. Is your choice.
I've been reading through developers.google for a few days now and this process is still confusing me.
As far as I can tell, I need the following:
An Android application
A Java App-Engine backend that uses Endpoints (still not quite
understanding what these are).
Code within this backend that connects to my Cloud SQL instance.
My problem is that none of Google's examples seem to have an Android/Cloud-SQL example.
I've been using this guide on how to create an Android app with App Engine backend. But then it uses Google datastore stuff, I think? I need to use SQL rather than this.
In this guide there is mention of App Engine, but for a JSP web form front-end, and no mention of Endpoints.
So my questions boils down to, have I got the right idea with using EndPoints + Cloud SQL, and if yes, how does one achieve this? I'm quite a JDBC newbie in general, so I'm not quite sure how to achieve this off the top of my head.
you are on the right track.
Just for the record, if you don't have strong reasons (yet) to go for a SQL data store, do consider using Google Data Store as it is better seamlessly integrated into the SDKs and after a couple of compromises it should help you pushing your data design to scale nicer.
Let's split it into parts:
First you have your backend/api. This is basically your piece of code that operates on Google servers, which you'll access on an remote connection basis (http, socket, etc) - (same as most of the APIs we know work). I don't know which programming language you are using but here is some basic set up for your project and Cloud SQL on Python.
Cloud Endpoints is nothing more than a very cool feature that App Engine brought recently to avoid all the mess of creating and updating your client libs over and over again. It basically automates that task for you, by using annotations or references you put in your backend code to create client libraries for Java, Objective-C and JavaScript that you can then integrate into your clients.
Example: Let's say I have a controller on my api to operate with bananas, that has a method to delete a banana from the api. Annotating that method on your api code, will let endpoints script know that this methods is there to delete bananas, thus it'll gather it and include it in the generated clients libraries, so that you don't have to do that manually for any of your clients, nor every time you update you api code. [Here's] some documentation.
Android Application. That's certainly your business :) But I'm sure having your api libs already generated already helps a lot.
Hope it helps. Let me know if you need to get more into detail.
I am building a web service for my ASP.NET MVC 3 website. Ideally I would like all clients (my web pages, iphone application, android application, windows phone 7 application, etc.) to use the same service layer to load and save data.
I am new to mobile development and was wondering if there is a preferred mechanism - SOAP/JSON/etc - to use a heterogeneous mobile device setup. Specifically I'm wondering if Android and iOS have better libraries/support for one protocol over another or if the main mobile platforms have strong support for all protocols. I am also wondering if all is even when it comes to securing said services.
Any advice would be much appreciated
Thanks
JP
I would suggest a REST(ful) service with JSON.
Both Android and iOS have libraries that support parsing XML and JSON, however the JSON libraries are a bit easier to use and are a little bit faster.
With a little more effort you could allow your service to provide/consume both XML and JSON.
It would be preferable to avoid SOAP as it is more verbose and not as suitable for the more bandwidth/battery sensitive mobile devices.
This would be a great opportunity for you to try out WCF Data services, together with Entity Framework. You can build it very fast, and it exposes your information model using the OData international standard in both XML and JSON flavor. The interface is accessible throught REST. No problems interacting with any front-end technology, fat, web or mobile clients.
AND, you have all the benefits of re-using your C# .NET knowledge, visual studio and created assemblies to also make more tighter integration with Windows applications if you need to. It certainly did the trick for me!
So:
Create your application model using Entity Framework. Either database first if you already have a physical datamodel, or model first is you are starting from scratch.
Expose the created information model using WCF dataservices (5 lines of code)
You can find a walkthrough at: http://msdn.microsoft.com/en-us/magazine/ee336128.aspx
Happy coding!
I have almost same situation and what am I doing is, I am making WCFrest services for android and iphone.
In terms of the security, I am using role based membership provider. So i have created a user for the mobile clients with the role of 'Mobile clients' and give the user id (guid) as an 'api key' to the android and iphone developer.
The iphone and android developer has to send the 'api key' in the header of the request.
so before executing any method in my wcf, i am checking the api key and also checking if the request is from an android or iphone device.
I hope this will help you a little to plan your development..:)
Try using ksoap2 and have your WCF services use the basicHTTP binding.
If you have only primitive types as parameters, this should very easy. With some work you can also use it for more complex types.