where to store my android app database? - android

I'm new to android. I have Login and register option and sqlite database.
I want to know if i have to store the database on server in order to login my app, or it's save automatically on google's server?

I haven't really built an app like that, but I've researched a little. I hope it helps you too.
You can use the SQLite database to store stuff locally, although I prefer using SharedPreferences because of its easy implementation for smaller details like username and some general preferences.
However, to create a client server login-registration like app, you can use GCM (google cloud messaging) and a server. Now its hard to explain what exactly am I trying to say and how to implement it, but thanks to this guy who made a Tut outta it. I tried building it and it works like a charm. I used a local DB like Xamp, but it works.
Link: http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
Link 2: http://www.vogella.com/tutorials/AndroidCloudToDeviceMessaging/article.html
These tuts will help you get a gist of GCM and how to configure a server to communicate with GCM and your mobile devices. Good luck!

Related

Store application data on a server

I'm developing an android app. And now I have a problem. I need to store app data somewhere on server side.
For example I want to store user rating by other users and some other data.
I don't want to develop my own server and API.
I mean I want any cloud-base platform for it.
What can I use for server-side data storage?
Fire-base is the Best tool which replaced the own custom server concept for small and new developers. If you need any further detail and help let me know, I'll help you. It'll provide you online real database and storage.
But if you need some clod functions to process data on cloud you can do so by using cloud functions and utilize it as a Server also.
Fire-base
You can use Firebase>>Firebase
Its totally free for small user. And not need to web related Code

Using Firebase as backend

For the past few days, I've been trying to understand what exactly is Firebase. I am in need of some more 'beginner-friendly' answers on the subject. My intention is to create a backend for my Android project. For my previous project , I used a GoDaddy host , PHP, MySQL and it did work just fine.
I am in need of stuff like these :
Storing string data. Like user email , password , profile picture path , number of friends etc.. (in a single row)
Uploading and downloading files. Video , audio
Creating a real time chat messaging system inside the app.
I am currently reading Firebase guides on user authentication. For example there is a method for signing a new user with email and password , but what if I want to store more than just email and password? Is Firebase fully customizable? Is it easy to use , or is it designed for professional developers only?
Firebase is fully customisable yes.
If you want to store more than an email,password etc, you can do so my creating a well structured JSON first. You can then try and map this to firebase db.
Firebase is a good and stable backend as a service platform and it is used by plenty of professional apps. It is fairly easy to use. Follow their youtube channel for tutorials. They have very good tutorials and explanations about how things work. I am in the exact same boat as you, learning firebase.
You may also want to look at alternatives like pubnub and pusher for the requirement of yours. They work in a similar way.
Hope this clears some of your doubts

How to create users in/for apps

I have a question that probably has a straight forward answer, but I am asking here to make sure.
If I want to develop an app with users (e.g. Snapchat, Wordfeud etc.), how do I do it? Do I have to use a database of some kind? The users will not have much information stored to them, say nothing more than a username and a score collection.
Can I do this without using databases?
And how do I even set up an app for having users?
You need a database.
For the simplest, you can set up a MySQL database on any server, and make queries to it.
You can follow this tutorial: http://codewithchris.com/iphone-app-connect-to-mysql-database/
You will need a database if you want to implement some functionalities like friendlist and sending messages.
To handle the authentication, Google has built in tools to help you :
https://developers.google.com/identity/sign-in/android/sign-in

Feedback from user to developer without involving Google Play

I want users to send textual feedback to myself(the developer) directly(without involving Google Play).
Hence, I can get the suggestions to improve my app directly to myself, instead of users writing negative reviews on Google Play.
I do not own a website nor have access to any server.
I do not want to use ACTION_SEND, as that opens an email app.
I'm an android beginner and this is my first app.
Maybe that data can be stored in a database(on cloud, common to all users) that I can access at any time I want?
After researching, I think GCM is supposed to be used, but I no idea how to go about it.
Please tell me the easiest way to implement this.
Thank You.
That is not what exactly what GCM is for. GCM is primarily for sending data from the cloud to the the devices.
You are correct in thinking that one option is to store the data in a database in the cloud. You could use http://pythonanywhere.com free account and build a web app that provides you endpoints which will save and retrieve data to a SQLite db pretty easily (if you have knowledge of python and server side web concepts).
Another perhaps simpler option is to use a pre-existing cloud database solution http://www.parse.com is a cloud backend that also has a free-to-use option that you can use to store arbitrary data. It is pretty easy to get up and running if you follow their many nice Android tutorials.
One last option I will present is to use a Google Spreadsheet with a Form associated to it. Once you create a form if you know the right url and parameters you can send a post request to insert arbitrary data into your spreadsheet. I've created a library that simplifies the process of uploading. GoogleFormUploader. If you need help getting your form set up you can watch the relevant portion of my video tutorial covering this topic

How can i get notifications from server to android device?

I am creating a app wherein user shares some information. This data i am storing it in database through servlets i.e. i am calling my own servlets which will take data through url and store it in database. So i want other users of that same app to get notify that some information is available and in turn they will get the information that other user has updated.
For this to work we can use polling or pusher. But polling will take lots of battery power.
I have tried C2DM but its not working for me. So i am thinking for some other mechanism by which i can implement other than C2DM.
Please suggest some way to work it. and e.g. if u have came across.
C2DM is deprecated, the new version is called Google Cloud Messaging (GCM) and is exactly what you need for your use case. There is even a GCM Demo Application which uses a Java servlet. The source code can be found here, you browse it directly or if you prefer GitHub you can use this repository.
The servlet code can be found in the file
samples/gcm-demo-server/src/com/google/android/gcm/demo/server/HomeServlet.java
If you follow the instructions in the Getting Started guide you will soon have a working application. I would suggest you not trying to copy paste it together, you have to get a clear understanding of how the GCM architecture is working.

Categories

Resources