Android/Webpage API architecture - android

If I have a website and an android application, it is correct to build a Rest API service to use it in both (web and app).
This way is more flexible to make changes one time right?
I'm using Hapijs and Catbox-Redis to handle the session store, also I am working on separated projects to deploy the API and Web projects on separated servers.
It is correct to use one API service for the Android Application and the Webpage?

It is absolutely appropriate. This is one of the big advantages of a services layer. It is very likely you will need some things that are specific to each, but most things will be common.
The really great thing will be when you have to write the THIRD interface that you don't know about yet (Google glass, apple TV, android watch, SOAP, who knows)

Related

how can i use azure face api in android?

I am trying to implement Microsoft Azure Cognitive Service Face Api for face recognition. Followed by https://go.microsoft.com/fwlink/?linkid=2184104 i created .NET Core console application and everything works fine. Now i would like to use this code in android app, but i am pretty stuck. Should i create rest api from existing C# code? Or there is android library that allows me to use face api directly like in console app?
Since Cognitive Services are already APIs, you could talk to the API directly and process the response right inside your Android code.
Please keep in mind that this does leave a potential security issue if the application is meant to go into the store / public. Users could look at the traffic or decompile your app, find your access keys and use your Cognitive Service for their own applications. In that case it could be interesting to wrap it in your own API and have some security checks in place there like rate limiting or call quota. Of course you need to make sure to use your access key inside of your own API to hide it from being seen externally.
Still, this leaves room for abuse. You now implemented a public API that, again, anybody could talk to. There are quite a few interesting discussions found on this, like this question right here on Stack Overflow: Restrict API requests to only my own mobile app.

Can I access standard iOS Notes and Reminders' data using CloudKit web services or something like that?

I am thinking of building an Android app that fetches Notes and Reminders associated with an Apple ID. Is it possible to access them with http requests somehow? icloud.com uses their data, so I thought maybe it is exposed via some API, but I cannot find any documentation.
There is none. The only thing exposed so far is the CloudKit api which is for accessing key value data that you created yourself.
If you want to access reminders, then you can use the iOS native api:
https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/EventKitProgGuide/ReadingAndWritingReminders/ReadingAndWritingReminders.html
A hacky solution that I use for getting the reminders I create or mark as done is IFTTT (https://ifttt.com/). You can download it on your phone. This has the option to get the reminders values out to a google document, google sheet or other place that you can later easily grab from with the google API. That is what I am currently doing. In addition if your intention is to create reminders you can use pyicloud (https://github.com/picklepete/pyicloud). Its small project that I am also using. Feel free to contribute!
I know that some may not like this answer, as it may be a very gray area, but assuming you had the user’s permission, you might be able to make your own API with a scraper tool that can expose an API to the data. This way you can make an Android app that accesses the user’s iOS data via the icloud.com site and then allows them to use it/manage it via your app on their Android devices.
Do a search for scrape tools and you’ll find loads of them available now. Their pricing often includes a free tier that may or may not be adequate for your purposes. ParseHub is a great one. There’s others out there that can get around certain troublesome limitations of the browser that ParseHub has if you find yourself stuck.
If the app you make has good success then it may be a good investment to pay for the upgrades.

Google Play Game Services on a desktop game

I created a game in Java using Libgdx framework. Now I would like to know if it is possible to use Google Play Game Services in a desktop (java/.jar) game, or is it meant just for mobile devices?
As I am faced with the same question, I do not have a complete answer, but I think the short answer is yes, you can.
But you'll have to use the rest API instead of a nice java API, and some features are not available (such as the real-time online multiplayer support). You can see the reference here:
https://developers.google.com/games/services/web/api/index
As you can see, the major stuff like anchievements, leaderboards, and turn-based multiplayer services should be available (and you can even see there is stuff like joining rooms, but they are marked as "For internal use by the Games SDK only."), so I guess the REST API covers the major needs.
I have yet to test this on a desktop aplication and for sure you'll want some support library to help with the quirks of the HTTP-REST protocol, but I think it is feasible.
EDIT: Since this API is meant for the web, you may still need some kind of initial JavaScript interaction with the user (using google's JavaScript libraries) in order to authenticate the user first, but the rest of the interaction can be done "server-side" (and in any language you want). Read this for more details:
https://developers.google.com/games/services/web/serverlogin

Google app engine - is it possible to create two web clients that will use the same datastore?

I created an application using Google app engine
I have two clients at the moment - one for android and another one for web application
and I want to add a mobile web application as well that will use the same datastore
I can't deploy the mobile web application because it will overwrite the web application that I already have
What do I need to do?
Thanks in advance
The Datastore is effectively partitioned by application. If you're operating on the same data, does anything prevent merging applications?
When you say two clients, do you mean two GAE apps?
The easiest (but probably not ideal) way to deal with it is to upload them as separate versions of the same app. GAE allows you to access different versions of the same app via different urls. You can then point your android app and the mobile web app at the appropriate urls.
Generally the better way to do it would be to design your mobile app and web app to use the same APIs.
This is a perfect use case for App Engine Modules, which provide multiple front ends (e.g. web apps, RESTful APIs, etc.) to the same underlying stateful services such as the datastore, memcache, and task queues. Each module can have its own set of versions, its own scaling configuration, and may be deployed independently of the others.
Java docs are here.
Python docs are here.

Building mobile app derivative of Rails web app

How does one approach building the mobile app version of one's Rails app, with little to no mobile development experience? iOS, Android, one or the other, or both.
First, you might want to create (private) APIs for services your web app provides. The de facto standard for Android apps is REST-like endpoints that accept/return JSON. You can use whatever Ruby REST framework works best. Then you need to consider how you would authenticate Android apps, if needed. Do you use the same authentication database? Can you allow anonymous access, what parts of the app do you expose, etc.
Finally, you need to build the frontend. A few options here:
learn Android
hire someone to do it
use a framework that lets you develop using Web(-like) technologies: Thitanium, Rhodes, etc. The upside is that you get to use what you know and might also get an iOS app for free.
The downside is that you can never get the native performance, and look-and-feel might not be completely Android-like (never used Rhodes, so maybe it does this well enough, but still)
Consider using http://www.rhomobile.com/.

Categories

Resources