How to fetch values from GAE datastore to android application ? - java

I'm creating a network based android application. So
1) I've installed Google App Engine Plugin in eclipse IDE and start developing a network based android applications where all information of customers are stored in GAE Datastore.
2) I've created a new Web-Application and stored Entities in datastore. Can i retrieve those values and show in my android application and add new details in from my application to GAE Datastore.
Please Help Me, I'm new to Web Service, SOAP, REST, JSON etc.
Can anyone tell me a simple method to store and fetch values from Cloud DB to Android App.

There are two apparent options:
Use Cloud Endpoints. They are proprietary and not my favourite. Also they are only available for Android, iOS and JS.
Use web services, my favourite would be JAX-RS, specifically RESTEasy+Jackson. See this GAE example and simple Android client.

Related

FCM with Cloud Datastore

I have a Java App Engine standard project (for about 4 years), using the Cloud Datastore (with Objectify). One of my services is using GCM to push notifications to mobile clients. Google has announced that GCM is deprecated and will be shut down 11th of April, and from then on Firebase messaging should be used instead of GCM.
After reading the docs it seemed straight forward to migrate, however I cannot create a Firebase database on my existing project, apparently I need to create a new App Engine project for this?
My question is, how can I use messaging on my existing App Engine project?
Starting a new project seems to me a bit overkill just to migrate from GCM to FCM.
Currently, once you select a database for your GCP project, you can't switch back. That's why you would have to create a new GCP project and a new App Engine.
I'm not very familiar with the Firebase products or the migration process from GCM to FCM, but if what you need is to switch from Cloud Datastore to Cloud Firestore, be aware that this change will be done automatically in the future.
You can also contact GCP support directly and request the upgrade.
I figured it out, I'm not able to create a new Firestore database, which is the "new" Firebase database currently in beta. This because I already using the Cloud Datastore in my current app engine project and cheese two cannot coexist whiten the same app engine project. However I was able to create a "old" Firebase database (real time database).
I don't really need a new database or my existing one migrated, I only need messaging to work (FCM) and using the Admin SDK the only way to initialise the library I need a database.

Https Spring MVC controller call with Android

I have a web applcation which is build in Spring MVC and MongoDB, what I want to make an app of Android (I am new in Andriod).
I am thinking to reuse that Spring Restful Web Services in Android app, and just make the frontend of Android app.
i have read about Spring Android but it's not what i want, i want to reuse the existing web services, isn't it java all about platform independent?
I have gone through many articles but they don't clear my confusion.
i have read about phonegap to convert html in an app, but i also want to synchronize the contacts in phone through android app which i believe is only possible with Android.

Is it possible to host Java Spring application over Firebase hosting?

I am seeking information about using Firebase (as database) for Java. Is this possible along with hosting of Java (using Spring framework) project over Firebase hosting.
It is possible. Use Google App Engine an environment for running application code in the cloud; Platform as a service (PaaS).
Below is description how make to make basic example.
In the this tutorial, you'll learn how to:
Create a backend service running on App Engine using Android Studio.
Connect the backend service to your data in Firebase.
The sample app stores a to-do list in Firebase, which automatically synchronizes the data across devices, and then uses backend logic running on App Engine to send out daily reminder emails:
https://cloud.google.com/solutions/mobile/firebase-app-engine-android-studio
By connecting App Engine to a Firebase database, you can perform complex logic on data without having to manage synchronization and updates; Firebase handles that for you.
No. Firebase offers hosting for static assets only.
The Google Cloud Run seems is most suitable for what you want.
Consider to check the documentation and pricing. Like firebase, cloud run also has a free tier that can help you develop your app with no costs.
The cloud run supports several programming languages including Java.
Once created the service you can try to connect to your firebase project...
Cloud Run Java Documentation

How to import my own android application project into IBM Bluemix?

Can someone help me use the new PaaS - IBM Bluemix?
I faced a dilemma that I want to import my android application project which was developed on my local computer into the IBM Bluemix and run on the platform ,but I didn't know how to use it.
I have search on Internet about this ,I still cannot find the solution.
Does IBM Bluemix support this kind of service?
I just want to debug or test on this cloud platform.
You don't deploy an android application to bluemix as the android application exists on the actual mobile device (or emulator) and not in the cloud. What Bluemix offers you is the ability to have services running on the cloud that can work with your android application on the mobile device. This is called MBaaS (Mobile Backend as a Service).
For example you can have a MobileData service that allows you to store data in the cloud that your mobile device(s) (iOS, android or web) can access (think of having a game save that can then be picked up by another user device to resume playing at the same point). Bluemix provides an SDK to access these services on Bluemix from your android application source code.
IBM Bluemix is a cloud platform where you can build web applications / mobile back end services utilizing a wide range of services.
Lets say you are building a weather app. This app will require two components
1. a server side web application
2. a mobile application (lets say android)
The server side component does only one thing, it constantly collects weather forecast from multiple data sources (eg www.data.gov, forecast.io etc). This app has restful apis exposed to internet which can be invoked by mobile app to request weather forecast for a particular geo cordinates (E.g http://weatherapp.mybluemix.net/getForcast/122.20,-100.20). The server app responds to get requests in JSON format.
The Mobile app, detects current location's geo co-ordinate using mobile phone's GPS and request weather forecast of the location from server component using a HTTP get (GET:http://weatherapp.mybluemix.net/getForcast/122.20,-100.20) . The mobile app then parse the response JSON data and display information on a neat elegant screen.
If you want to port this app onto IBM bluemix, you can build the server component using, NOde.js or JSP or PHP etc, use mMongoDB,mySQL DB or Postgresql databases, use twillio for text messaging/mms or voice call, use IBM Push for notifying user about weather forecast etc.
Using Android SDK, IBM Cloud services SDk (Mobile data, push notification etc) and sell it on Google play.
Hope this helps
-Keep coding-
We have sample applications for Bluemix which can be deployed on Android. See the "boilerplate" app in the Bluemix catalog named "Mobile Cloud". Head to the Bluemix console [1], click on "CATALOG" at the top. The Mobile Cloud docs [2] reference several applications for iOS, Android, etc with server-side pieces can be deployed on Bluemix.
[1] https://bluemix.net/
[2] https://www.ng.bluemix.net/docs/#starters/mobile/index.html
you can refer developerwork article to get started to use Bluemix services for your andriod app.
First ,you need to login to bluemix and create a new account in ther,
There u have create an application in ur dashboard,where the runtimes in node.js,and add the following services namely,push,mobile data and mobile security application.
Then u need to download the android SDK available in it and add to ur android app all the jar files in the libs folder.
U need to save the app id,secret id and the link in order to connect it from local android app to bluemix.
Hope this was useful,if any doubt further,let me know

Developing Android Application w/ Existing App Engine Application

I have existing appengine application. I'm planning to develop android application with that existing app. I can only find examples on development of android app w/ new appengine application. Any reference for developing android app for existing appengine project?
There is nothing special about it. You have to add some sort of an API that your mobile apps can use and return data in an easily parsaeble format such as JSON or XML. You have think about whether you need authentication and how to do it (Google accounts are integrated in Android, but you need extra permissions to use them). Then you access them from Android using HttpClient or HTTPUrlConnection.
The 'new' way to do it would be to use Goggle Cloud Endpoints which takes care of authentication and generates an Android client for you automatically. However it is still in
'trusted beta', so you might not be able to use it.
http://endpoints-trusted-tester.appspot.com/

Categories

Resources