firebase integration with android instantapp - android

I am trying to use firebase's real-time database with android instant app.
Looking at google doc for using the real-time database, I do have bit of idea.
However the example that google provide is base on android app, not the instant one. As you know that there are multiple modules for instant app. base, app, feature(default name suggested by android studio). Should I add firebase packages in each of appGriddle, baseGriddle and appGriddle?
What about the JSON file generated by firebase... where should I place that JSON file? If the app is not instant one, I know that I just need to place it in app..There are multiple modules...
I try to do it with android studio's firebase tool for configuration. However it does not work. I looked up others attempt;changing "implement" to "api"... It does not work either.
Please let me know if you know a way to deal with instant app and firebase's real-time database together
Thank you.

Can you explain more on what you mean by 'Instant' app?
All the docs are available in the firebase website:
https://firebase.google.com/docs/guides/
There are guides for iOS, android, etc.
For a start, have you create your database by logging in the Firebase online console?

Related

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 connect and use google cloud sql for database access?

I know this is a nooby question and I apologise in advance. I'm looking all over but I just can't seem to find any documentation on connecting an Android app built in Android Studio to a Google Cloud SQL Database.
I'm only really doing this to try and find out how it is done because I'm interested in it but I'm very new to Android development. I've connected to a SQL database before from c# but it was only a local one, I've never connected to an online one before and I think the Google Cloud Platform operates a bit differently anyway?
Basically, whenever I try to find documentation for this, it keeps referring back to the Google App Engine, which seems to be a different way to create apps than just writing them in Android Studio (very likely I could be wrong, like I said, I'm very new to Android development).
I've seen that there is documentation for Eclipse with the Google Plugin but can't find anything for Android Studio. Is Android Studio not suited for this type of use?
I've seen that you can create a Google Cloud module for a project in Android Studio but I'm not exactly sure what that entails.
Basically, I would just love a set of very basic steps that I should follow for if I were wanting to write to a Google Cloud SQL DB from an Android app in Android Studio.
Otherwise, any good resources where I could possibly learn more about what I need to do would also be appreciated.
I think my biggest issue currently is that I have exactly 0 backend knowledge and so I'm just not really sure of what is required to set up this connection.
You should not access Cloud SQL directly from your Android (or iOS) or other client because you cannot secure the credentials needed to do so. If you embedded your credentials into your app, someone could extract them and either gain access to your database directly or could cause other trouble for you.
If you are open to other database types and you don't want to explore proxying requests through your own backend, then you should take a look at Cloud Firestore or Firebase Realtime Database. Firebase provides SDKs for Android that allow you to access these securely directly from your app. Firestore will scale better than the Realtime database, but that might not matter for your app.
A similar question and reason for why you shouldn't try to connect directly to Cloud SQL is covered in more depth here.

How to use Algolia in Android with Firebase content

I made an app where anyone can sell a product: you set its details and then I save it in Firebase.
On the client side (Android app) I want to be able to search for products using plain text.
I think the best way is by using Algolia but I really have no idea how to set-it up. Your help will be appreciated!
There are actually two topics in your question: how can one link Algolia to a Firebase database and how can one build an Android app with Algolia. I'll cover both in my answer.
How to link Algolia to Firebase
You will need to use a scripting language to import your existing data into Algolia and to sync the changes when your data is updated. Algolia has a guide to help you do so using Node.js.
You don't need to be experienced with Node.js to do it! Have a look at this question where an Android developer like you with no prior experience of Node.js just followed the guide:
In the first gathering of data, I just copied the integration code, did the necessary changes and ran it on Windows terminal: the data is now imported from Firebase to Algolia.
You simply need to:
Copy the code samples from Algolia's Firebase guide
Replace the credentials with yours
Run the scripts from your computer (if you never ran js scripts locally, search for a Node.js beginner's guide like this or this)
Once your data is imported in Algolia, you can move on to step 2:
How to use Algolia in your Android app
For building your search interface with Algolia, the recommended tool is InstantSearch Android. It's a toolbox that provides you plug-and-play components to build your search interface quickly: InstantSearch will handle all the network-related issues, the data-binding, and many other things so you can focus on what's specific to your app.
You can have a look at InstantSearch Android's demo apps which will show you examples what you could build using this tool, like this Media demo:
Algolia also provides an Android API Client for building apps. It lets you interact at a lower level with Algolia: you send the requests, get the results as JSONObject and decide what you want to do with it.
Most projects should use InstantSearch Android as it is built to make your development easier and faster (and it actually uses the Android API Client under the hood!)

How to upload an image to Google Cloud Storage in Android App

I am attempting to use Google Cloud Storage to store images for an Android Application I'm building. I'm a beginner with cloud stuff but I've already set up an endpoint to store structured data in the google cloud datastore and I'm using app engines standard environment.
I've read conflicting things about how to go about this but I'm currently using this guide: https://cloud.google.com/storage/docs/object-basics#storage-upload-object-java and trying to do it in the endpoint I've already set up. I did try to use the library directly in the app however trying to run with the dependency for it caused the app to crash on startup.
The guide I'm using doesn't talk at all about setup like how to get a bucket object of a given name (I've found how to create one but I want to use my apps default bucket which already exists).
Questions:
1) Is doing it in the endpoint the best approach? I want the simplest possible solution so I don't really want to use an extra thing like firebase if I can avoid it
2) For whatever solution is the best, can you give/link me a comprehensive explanation of how to hook it up starting from the Uri I get from the FilePicker all the way to uploading it to GCS? I've found so many explanations which explain part of the process but they don't fit together.
https://github.com/TdevM/FirebaseStorageTest/blob/master/app/src/main/java/tdevm/storagetest/ui/GalleryActivity.java
Here's my test project which i created to upload images on Firebase Storage. Firebase Storage is based on Google Cloud Storage.Comment back if it helped !
If google drive app is installed on the device where your app runs you can simply use intent `ACTION_CREATE_DOCUMENT to create a file in the cloud.

Categories

Resources