I am writing an iOS app. It will store details of something on a server somewhere.
I will write an Android app that will offer the same functionality.
I want to access the same database and retrieve the same data no matter whether it is the iOS or Android app being used.
I would appreciate some "keywords" for a technology that can abstract the back end data store so be something common for both iOS and Android.
If there is an example out there on GitHub a link would help me
Thank you
You can use any database that meets your data modeling needs and performance requirements, which one you chose should depend on the structure of your data. What you should be doing is building a shared middle tier server that persists your data and provides it to your iOS and Android clients. You probably want to pass the data between the client and the server as JSON documents using the http protocol. This is generally known as a REST api though you have to follow certain design principles to really be a REST api.
You could write your server side code in Swift, Java or Kotlin. This would allow you to reuse some code on either iOS or Android depending on which language you chose. You could instead use Xamarin/.NET Core to write the server and both clients in C# (or F#) which would maximize your code reuse.
If you don't need or want to use a relational database, you could use MongoDB or a similar JSON document store. You could pass those JSON documents directly to your clients. That would reduce the amount of server side code you need to write.
Here is a good link for using Microsoft Azure Cosmos DB. there are loads of samples and best practices. Information on how to secure the database. how to use partitioning correctly. Cosmos DB is really easy to implement as you don't need an ORM. it has everything built in. I am using Cosmos DB for Xamarin app I am building. It is working great so far. The best thing about it is you can scale up or down pretty easily from the azure portal. below is a good introduction and all the samples you need.
Introduction
Getting Started
Samples
Hope this helps.
Related
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 am developing an android application which needs a backend to process login and store data remotely on a server. I have previously worked with a BaaS service "Parse" for android. but since this is my final year project for my university I need to develop a backend from scratch, I have never worked with web services. I need some guidance on how to approach this and which framework will be the best to work with.
Thanks in advance.
If I understand you correctly you want to build a server application that allows you query data from your android app?
I'm not an expert on this since i just started coding myself, but I did do some research and it seems to be a very viable option to implement a RESTful API on the server side. The wiki article is pretty specific about how it works.
If you can use PHP the slim framework allows you to get a scrappy prototype RESTful API up in less then an hour if you familiar with the server configuration. It seems to be sophisticated enough to drive small and medium sized projects (maybe even big projects; I can't tell to be honest.)
On the start page you can see an example that allows you to query for a "hello, world" string from the API with less then 50 lines of code.
http://www.slimframework.com/
Where the example returns a "hello world" string you would perform database queries using PHP and return your results as json objects to your client.
The benefits of this are that you can use this Backend for different clients: Android, iOS or even your own browser-based web application.
This also makes it easy replace / port the backend once requirements change since it's very easy to implement the same API using other technologies and languages that fit the requirements better.
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 develop a application where part of the data is dynamic like picture , show timing etc.Their are many content management system that use HTML5 and CSS but i want to also use the native iOS or Android Ui like the UISplitView for iPad.How is this possible ? whats the best way to manage and use dynamic data ?
I have been digging into this very exact answer. The best answer I can come up with is called parse.com. Which may not be 100% of what you are looking for. However. What it does is serve as a central database that talks to multiple platforms(windows 8, iOS, Android) and offers up an api for use with every platform with lots of documentation to make programming super easy. http://deployd.com/ also This site is something Ill be looking into which uses a simplified node.js desktop for programming easy objective based functions with a database. Definitely am still looking. Either way the bast thing is to call your view...bring in a few objects...and have these databases feed your objects to specifically answer your question.
As a developer Im used to Joomla and magento. These arent necessarily ios friendly. Anyway, best of luck.
I'd suggest taking a look at Cloud CMS (http://www.cloudcms.com).
Cloud CMS is a cloud content management system that is built around JSON schema. Unlike traditional web content systems, Cloud CMS works with JSON and binary files (either through MongoDB GridFS or Amazon S3). It provides full-text search, structured query and an entire suite of enterprise features for things like workflow, analytics, users and groups and more.
From an iOS or Android viewpoint, you really only need to interact with the REST API. You can do that directly or use one of the client libraries.
Disclaimer: I'm one of the founders of the company. Would love to find out what you think and learn what we can do to improve things. We're having a great time reinventing CMS for mobile.
I'm building an application for android which collects user data.
Also I'm going to build a website which will use that data where users can have an account and synchronize data with phone and website (I guess it's quite common setup).
Site will be using MySQL database, but I want it to be database independent using some kind of API.
I think I'm going to use Python for website (Django).
Since I haven't started whole synchronization part yet I have a question on how to do it best.
Which protocol to use - JSON, SOAP, XML (any other)? Which is best supported in android?
What are the best practices in doing such a thing?
Leonti
Android lacks a built-in API for processing SOAP or XML-RPC requests, so I would go with a REST-style Web service. JSON is probably the easiest from an Android perspective to consume and create.