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.
Related
My client has Joomla website with plugins (Mosets tree and JSE events) that basically lists business an events. He wants an android app developed to fetch these info. Immidiately what came to mind, is I create php scripts that query the Database and I call those scripts from my app. In my app, I display the information collected.
Another idea that occurred to me, is to enable RSS feed and then I read this RSS feed.
Is my approach above the right approach? Is there a different way or standard way when developing apps that fetch information from the Joomla website backend?
Please note the website is already mobile friendly but the requirement is to create an app for part of the website. Any pointers are helpful
Building one or more PHP scripts that query the db and returns the data is definitely the faster and simpler solution.
If you want to build a more robust / compatible solution, you may extend your set of PHP scripts into a full blown REST API application. In that case take a look frameworks like SLIM or SILEX which are very good at this.
There are more complete and elegant solutions but they are probably overkill for your needs.
Edit: why query directly the database
In theory, it seems to be better to NOT access directly the database, and interact with the Mosets Tree component instead; because in that way you will not have to duplicate any logic.
But in my experience, with a very few exceptions, Joomla components are coded so that it's very hard to interact with them programmatically.
I answered a similar question regarding Joomla RESTful APIs here:
REST API for Joomla 3.0
Basically, I ended up developing a solution which meshes the Slim PHP micro-framework with the Joomla Framework / CMS (requires Joomla 3.4.3+).
Why?
Well, the main reason is that while using the Slim framework would be OK as a one-off solution, I realized that one would still need to develop all the accompanying ACL and access security, not to mention the actual CMS that might store and manage all the important data in the first place.
Basically, I did the work so you don't have to. Yes, it's a commercial component (must pay to download) but I think it's WELL worth it for what you end up getting out of it.
It's brand new, so the service routes in the cAPI ("Constant API") Core package are still limited, but those are being built-out over time (all included in the core package of course). The component/plugin/library package is architected to allow for easy integration of add-on plugins which will introduce new service routes to add functionality like RESTful JSON APIs for MySQL, MSSQL, MongoDB, LDAP, etc. I already use an alpha version of the LDAP add-on in a an enterprise environment, so I expect that to be available for purchase/download soon.
The point of all this is that you can use an existing Joomla site to drive mobile apps (with some development for Mosets), while taking advantage of built-in user management and ACL, along with token auth (via cAPI).
Let me know if you have any questions.
I want to build an app that sends data from device to device (android-to-android or android-to-iOS etc.) and I was starting to look at the server side aspect.
I was thinking to myself, should I use an MBaaS platform of some kind or build the backend myself?
is it better to use MBaaS because its less time consuming?
is it better to implement it all by myself because it will require less financial resources?
any thoughts on the matter?
Please advise.
I would do look at MBaas as a starting place. You can always decide later to 'port' your application later. Start with your basic requirements: Authentication, Role-Based Access Control, REST API, Business Logic and Event programming. The best part of MBaas is there dozens of vendors that will give you a free trial (like Espresso Logic). Make sure the pricing plan meets your long-term objectives. I have built services from scratch and trying to get all the services right and integrated takes a lot longer. Time is money - so balance the two.
I'm building a new application for android and this would need to send and retreve data from an online database.
Firstly is this possible or is it a completely wrong approach?
Would i be able to tell my application to set certain data into the server and retreve other?
Does it create security risks by which anyone would be able to access the database?
It's my first time dealing with anything close to databases so i'm still learning.
Is there any website i can use which sets up an accessible SQL database?
Thanks for your help!
The Good approach for this is that you should create REST (Representational State Transfer) API on server and perform CRUD operations in your Android app using that API.
There are a lot of security problems with embedding direct database access into your app.
Usually,REST architecture is very useful to build client/server network applications. REST basically works on HTTP protocol and implementing REST is very simple compared to other methods like WSDL etc.
There are many good tutorials available on implementation of REST API that you can easily find by Googling it.
Here's one of them: http://www.androidhive.info/2014/01/how-to-create-rest-api-for-android-app-using-php-slim-and-mysql-day-12-2/
Yes, it is possible and it is not the wrong approach. Web services/REST API's are some things you should look at.
There are obvious security risks associated with having an outward facing web service or database. OWASP has a pretty good
web services guide that should get you started with the
security. You will need to address these risks prior to holding any sensitive/user information. There are plenty of guides online.
A couple of database hosting suggestions Amazon Web Services if you want it to be manage dfor you or create a VPS at Digital Ocean (or similar) website if you want to do it yourself.
Due to the open ended nature of this question there are numerous ways you can address these problems. I recommend spending a lot of time researching and analyzing them prior to starting the project and deciding on a technology.
This is not a wrong approach, most of the Android application send or receive data from online databases.
For connecting your Android app with the online database you can make of webservices , for instance you can create Rest Api for this.
For creating Rest Api using Asp.net web api visit this link
The answer for your last question would depend on the way your write your web services decide the security risk.
You can also use this reference
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 developing a system including an iOS and Android app. I have two approach:
1 - I thought about use MySQL as the backend.
And then use REST in java using jersey to transfer my resources to the apps.
2 - Currently I heard about Parse which is consider as a easy way to add a backend to the mobile applications. It lets the mobile developers write server code without servers.
Which one is your suggestion? please support your answer with proper reasons and your personal experience.
If you want to be trendy, use node.js and MongoDB. (Although MongoDB is not trendy anymore, but it allows binary files of arbitrary length and works beautifully.) PHP with MongoDB works fine too.
My reasons: they are widespread technologies and with a very low barrier of entry. Avoid Java unless you want to nurse your JVM.
Assuming your typical backend for a mobile app which involves one or more REST apis and provides server-side functionality such as user authentication, communication (e.g. chat, messaging), or persistence (e.g. a leaderboard for a game, or retrieving geo-location related data). You basically have the two options you mentioned, build yourself or use a backend-as-a-service platform.
Build yourself (pros):
You retain all of the IP
You have the best level of customization
Build yourself (cons):
Very high learning curve if you lack server-side coding experience
Longer to implement, and harder to iterate quickly if you need to change something or add a feature
Higher risk of critical issues if you lack experience (e.g. security vulnerabilities, reliability etc)
You need to monitor and maintain the system once it's deployed. This can become a full time job if the app gets big enough
Backend-as-a-service platform (pros):
Much faster to get something up and running. This is a big one if you're launching something new and want to validate the market
Benefit from the years of experience of server-side developers who built the platform
Often, platforms will provide ready-made components that already do what you need
Running and operating the backend is included as part of the service, you don't need to worry about it.
It's actually cheaper than implementing it yourself if you consider the time investment, or if you hire a backend developer to build it for you
It allows you to focus your energy and time on the client side app, which is where you'll most likely differentiate yourself anyway
Backend-as-a-service platform (cons):
You have less flexibility, depending on the platform (some are better than others)
There's usually a recurring cost (although you'll also incur some of this if you build it yourself, to run the servers and databases)
There's always a risk that the provider will shut down (like Parse) and you're left scrambling to find an alternative or rebuild it yourself
There are now many backend-as-a-service platforms available to chose from. Unfortunately, Parse is no longer one of them, having been acquired by Facebook and subsequently shut down https://www.computerworld.com/article/3027537/application-development/facebook-is-closing-down-its-parse-developer-platform.html
I feel that a backend-as-a-service platform is a good option if you don't have much experience on the server side, or if you have limited time and want to focus your attention on the client side app. One of the greatest benefits is fast iteration. You can try something out and change it quickly with relatively little investment if you realize that your feature didn't hit the mark. 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:
http://pipegears.com (No coding required)
https://www.appcelerator.com/
https://cloudboost.io/
http://api.shephertz.com/
https://backendless.com/
https://quickblox.com/
I participated in the development of an iOS/Android app. We used a server coded in java working as a web service running on Tomcat 7, with a mongoDB database, and JSON parsing for communication. Certainly not the best solution ever, but it was working.