How to incorporate Api into Android Studio - android

I am using Android Studio with Kotlin language.
I have created my front end.
I have the DB linked in this app but my API is done in a different App.
I am battling to figure out how to put my API into my App and have them communicate.
How would I incorporate the API so that my App uses the API to check, validate, read and write data into the database?
The API was created using .js and .json files.
Any assistance will be greatly appreciated.
Thank you

Related

Unity Android access to web based API? System.Net or UnityEngine.Networking?

Ok, so I have a MySQL DB holding my workouts, I've written API to produce json, and I want to access it from my phone. I built a Unity Android App using System.Net and System.IO to retrieve JSON and put it into a serialized object. Works great on the PC, but when I put it on the phone it doesn't retrieve the data.
Started working on a version using UnityEngine.Networking, but have to rewrite my code to handle the async read, so I haven't tested it on the android device yet.
Does System.Net work on Android Phones in Unity? Is it most likely a permissions thing, or does it flat out not work?
If I can't use System.Net, would UnityEngine.Networking do the trick? Or is there another protocol that can have an Android app read JSON from a web API?
Your question about System.Net supporting on android devices has been answered by #fattie here: Is System.Net.Sockets compatible with Unity targeting iOS?
But anyway, you can use UnityEngine.Networking instead of System.Net. For more information see https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.html

How do I connect a webapp and an android app with firebase?

I have been trying to learn how to create an app that allows people to upload images via the web or android.
I know that Android uses content providers to implement a mechanism for the sharing of data between applications. More specifically, Android uses the MediaStore API to make use of this functionality. However, that is limited to other Android devices.
I was wondering how I would go about connecting a web app made using reactjs to an Android app preferably using firebase. However, if it isn't possible in firebase that would be okay too,
I am a beginner in web app development, so I am not particularly sure about how the software's architecture will look like.
I have been struggling to find an updated concise solution online. Can anyone point me in the right direction and if not point me to some resources that will guide me in the right direction.
Thank you!
Attach/configure both of your application to use same database and storage bucket in firebase
As you can see I connected my android application as well as web administration application to same firebase project.
As you can see there is an add app option in firebase console where you can select platform. Register both of your application on same project and thats it.

connect to google cloud mysql using android studio app

I am doing a project which requires me to query google cloud mysql database to save, delete, retrieve and update data using app build in android studio.
I have been googling for quite some time, all the tutorials are using AppEngine. However in android studio 3.0+, there isn't any App Engine available anymore.
Please give advice / guidance on what should I do?
thanks in advance
Since Android Studio 3 doesn't support AppEngine anymore, you have two options:
Build your own custom backend (web service) to function as a layer that allows database consumption via the Android app. This will require more development effort than option 2.
Set up Firebase and use its database instead.
You will have to do a bit of research on getting Firebase up and running, but you wan't have to build a custom backend.
If using the Google Cloud MySQL database is a must, then you can't get around to foreseeing your own backend layer.

how to include client libraries in 2nd android application generated by GAE Backend for the 1st android app

I have successfully developed an android application with Google App Engine as the Backend. Now I want to develop 2nd android application and want to connect it to the same App Engine of the 1st App. In short. 2 android applications with same App Engine at the backend hence common datastore.
Could not find the detailed and satisfactory answer, please provide the answer in detail. Thanks
I am assuming that the first Android application connects to the App Engine backend using a REST APIo r in general a Web Service. That is the recommended route and you should be able to use the same API in your second Android Application too !
Do give more details if this is not what you were looking for.
Surprisingly, the Eclipse plug-in doesn't really support this - it will only automatically copy the generated client files into a single project.
Fortunately, there are some (manual) solutions that are discussed here:
How to move Cloud Endpoints generated sources.jar library into Android project

How to access one Cloud Datastore(Google App Engine) from Android app and django-website?

so I created App Engine Connected Android Project, I successfully deployed it to app engine server and I`m able to upload and retrieve my entities from my android app.
Now I want to create a website, which should access same entities and most preferably I want to code it in python-django. Is it possible? Or create django website and then somehow add android access endpoints? I couldn`t google anyhing useful.
Im stuck here and will be really really thankfull. This is my first app engine app so I hope Im not asking stupid question.
If I understand correct, you already have deployed your core functionality on the server side via Cloud endpoints and are able to access that functionality from your Android client.
You can definitely access the same functionality via a web application (this could be the same App Engine application in which you have hosted the cloud endpoints) or it could be another web application also. The Endpoints can be accessed via a JavaScript client API that Google provides. Take a look at the following API : https://developers.google.com/api-client-library/javascript/ and the documentation for accessing endpoints via JavaScript : https://developers.google.com/appengine/docs/python/endpoints/consume_js
The projected you created using the wizard using Java on both Android and GAE. You could add a web client to that as described in #Romin's answer, but you can also use Django.
I think the best way to do this is to scrap the Java server that the wizard generated and replace with a Django/Python runtime. As you suggested, you can then use Cloud Endpoints to generated Android client code from your Python code.
It is possible to stick with the generated Java Server and use Django but I think that adds unncessary complexity. YOu would need to either communicate between the Python and Java applications, or use the new modules feature to have 2 different runtimes in one app, but this will probably result in greater cost and it would be a cutting edge use of a new feature. I"ve looked at the Java modules docs and don't see how one would add a Python runtime to complement your existing Java runtime, but apparently it is possible:
https://groups.google.com/forum/#!msg/google-appengine/1228g7-qXZY/_ubjgHlE2_wJ

Categories

Resources