Web service for android social networking app? - android

I am developing social networking app on android.Rough idea of my app is that when user launches an app it will get all users of this app in near by location.So for storage purpose of users data I want to use web server. I don't have an idea what is best way to start with.Should i use Amazon web services ? (S3,Ec2) I was surfing internet got these buzz words.
Please guide me what is best approach for database storage ? Should i write my own server api ? or What ?

These are some general things you will have to do:
Buy some server space where you can host your server (this is the amazon ec2, etc). If you need a fancy domain name, buy that too, and map it to IP address of the server that you brought (optional).
Setup a db of some kind on this server to store your data (msql)
Write wrapper web services (php, jsp, etc) which will expose apis to access your data remotely. For security reasons, you should also have some authentication using some token passing mechanism.
Access the data on your server remotely using the APIs you created in the web service.

I personally favor using a MySQL database with PHP to interface between the app and the backend! Your app can send requests to PHP and then your PHP webservice would write/read to the database and then return JSON to your app.
I would say this is a very subjective question though as there as so many ways that you can write a web service.

Related

How can I connect the between web application with an application?

1) I have a web application. This web app is for a user to buy a point.
2) I have an android application for parking payment. Payment is based on point that user buy from the admin. Since I made two things which are web app for admin and android app for user, so I will have two database for each one right?
3) So, how can I transfer the point that user buy from the admin to an android application? Is this thing has to do with JSON fetch or pass data?
4) Basically I want the user to get the point from the web application? Your answer will be really helpful to me, thank you :)
The issue is design issue. Your mobile app and the web app don’t have to be two separate.
You can have one application with one database that both web and mobile point to.
If you’re using Android look into ionic framework that can help you code one codebase targeting both web and mobile.
See
https://ionicframework.com
https://scotch.io/tutorials/create-your-first-mobile-app-with-angularjs-and-ionic
You will have to build a single server for both your admin and your app. Both will have a single database that is controlled by your server. Your app will request the same server to redeem points and your admin will request the server to add points. You can use retrofit library in android for making api calls to your server
The web application and the android application must connect to the same database on the server. In the android application, to you get the data via json, you must use asynctask to download the server information or use libraries like Retrofit or volley that facilitate the handling of json.

Android mobile apps retrieve data from cloud

I wish to have an overview on this scenario.
Please be layman term, I am slow learner.
Here is the scenario:
Android mobile apps connect to the cloud, then the cloud will return a website link for me. eg. http://www.example.com/123
Website link to be return can be control by admin on the cloud.
Mobile apps will only request the link from cloud.
The cloud there will only sending the link to the mobile apps when have request.
Problems:
What is cloud? what can be done on cloud?
How to connect the mobile apps to the cloud?
What need to be done on the cloud? host a server?
How the mobile apps connect to a website link? using uri will redirect me to the browser. i wish it can be just connected.
Thank you very much.. ^^
What is cloud?
In the simplest terms, cloud computing means storing and accessing data and programs over the Internet instead of your computer's hard drive. The cloud is just a metaphor for the Internet. In this case it refers to your server. Which you may need to purchase. (Server space + domain name[optional]).
What can be done on cloud?
Accept some requests from the client and return some data.
What need to be done on the cloud? Host a server?
The server has to be configured so that it can receive requests from the clients (mobile app). For this you need to install a Web server application like Apache, tomcat, ngnix, IIS, glassfish...etc (this depends on your server code). Also you need an application where you need to write the logic to handle the requests and return the response (In your case the website link). The application can be wriiten in PHP, Java, Python, javascript, .NET,..etc. The client communicates with this application.
How to connect the mobile apps to the cloud?
How the mobile apps connect to a website link? using uri will redirect me to the browser. I wish it can be just connected.
Basically (on Android) you make a simple URLConnection to the server from your code. Or you can use some libraries like Volley or Retrofit. Make sure your app has INTERNET permission. These are a million (more maybe) tutorials on the internet that can tell you how.
use free hosting or purchase hosting and try to learn about restFUL api..
try these tutorials
Android Volley Post Request Tutorial – User Registration App
Android Studio Volley Tutorial to Create a Login Application

Sqlite database login system

I'm trying to create a login system for an android app and I would like to know if creating a Sqlite database solution would work across different devices. For example if I register in a device, could I access the app from another device with that same account without having to register again? If that does not work, what would be the solution? Thanks for the help :)
Ideal solution would be to connect the app to the server for authentication and authorization. The server can be build using any type of database whether it is sqlite or mysql etc. So it does not make any difference.
You can create a web service for the purpose of authentication using php, java or .net (your choice) and the android application can use any web service client framework such as service stack etc. for connecting to the web service.
What kind of authentication and other features you want will depend solely on your application design.
The best option is using a web server. I am doing the same and am using a .net web services for users authentication
For allowing same user to loggin in different devices with same credentials in the app you need to use central database .
Below is the link which will help you a lot.
http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
Note : Sqlite database is the local database , we can not use it for our central purpose or out of the specific device.

Phone Gap Cross Platform Apps

I am new to the mobile development. I am taking online classes and researching, but normally is it a requirement to have a backend database to store information for a mobile phone app or where is data normally handled with phone apps? I'm thinking of even simple examples of storing phone call logs or task items for user retrieval. Also authentication, when setting up logins, would this happen normally from a backend database or authentication server that the app creater needs to maintain?
THank in advance
Typically back end data is stored in a database in a server as done in web apps. Then you will expose the data using an HTTP based service (e.g. ASP.NET Web API) so that its easy for JavaScript to communicate with the service. data is commonly encoded as JSON transferring data between the service and your app. Now your mobile app will take data from the service and display in the UI and for updates data is send to the service and the service updates it to the database.

Mobile app database access

I have been asked to write a mobile android app to interface with a website. When pulling content from the site, I don't think scraping the site would be very efficient. I would like to interface with the database. Think of the scenario as facebook mobile app interfacing with the facebook databases that fuel facebook.com (so there's a mobile app, a web app, and a database in this equation). Would I just create a db account for the mobile app and then every phone using that app would use the same database account (This sounds like a terrible idea imo)? The user will be asked to authenticate in the app before they can start getting information from the it.
In general you don't want to be accessing the database directly via the phone (if that is even possible). The more standard way with mobile clients is to build a set of RESTful APIs that you can invoke via normal HTTP GETs and POSTs. These will present the data in a more lightweight (JSON, XML) way to the app, so that the "decoding" effort is reduced. Authentication is done via standard HTTP AUTH. That's the short version.

Categories

Resources