Put some values on internet to access from android - android

In my app a user can (only) see the values uploaded by admin.
For example. A salesman is using the app will be able to see the latest rate provided by the manger to trade.
Now the question is "where to put these values?"
I have .net webservice experience with android but I guess it wont work in this scenario,will it?
Any suggestion that the returned result be in (preferably) XML format.

It sounds like you already know how to do this. You can download and parse xml within your app. If you alreayd know how to set up the websever, the rest is easy. Limiting who can see what is just a matter of associating specific transactions with an individuals account. Then just have the phone check for updates on that transaction when the app loads (using someting like AsyncTask) or if you want to get more complicated you could push notificatinos using the android cloud service, or even use a REST model. More details are needed for a more specific answer but you can do what you want.

You can do it on your own, and build a webserver with a MySQL/PHP JSON API or you can use parse.com for a smaller project.

Related

How can I change content of my app after it is published without updating version?

I want to make an android app that will display mess menu of hostel. The menu will be changing every week so how can I change content of TextView once it is installed in user's phone .I considered WebView but I want better alternative . I think I need some cloud based service here . What are some good resources to achieve this.
Just do a Simple REST API and then every time you start your app call your api to retrieve the information, for example
yourdomaing.com/api/menu/getmenus should retrieve a Json with every item on menu.
You have plenty languages for making a simple rest api
check this related link
Examples of REST APIS
You can store your data (Text/Media) on firebase,It is very easy to start and then enable firebase offline functionality so that it is not required to download data on each launch of application.
Update data on firebase and add valueEventListener in your activity to get that data.
An alternative could be Firebase (by Google).
It's a free and real-time service. It allows you to change the content while the app is running. See "real-time database" and "A/B testing" in Firebase.

I want to make quiz app that I can update on daily basis

I want to make an android quiz app that I can update on daily basis.Like update daily General knowledge question answers .New section of question set date vice . I am just a beginner in android and need some guidance . So please guide and give some reference that I can use .
You can use Parse.com for such purpose.
Here is link for parse.com for documentation link for parse.com usage example take start from this site link last but not least do follow official android docs link
As you are saying you are new to Android so keep it simple just make the app to fetch the data from server. The other way is to store the data in SQlite and make your app run offline also.
As you have asked I can update on daily basis
So if you want to updates the question then you can do that from your server itself but if you want to update your app then you need to make your app in generalized manner thinking of your future updates, so that you can easily integrate the future functionalities whenever you needed.
for starters, keep the code and data separate, so you can trigger a fetch from a webserver (in XML or whatever format) with the day's quiz data, then parse and display it from your program. and cache it in a text file so you have something to use in case there is no web connection; nobody likes an app that just hangs.

Google Fit Custom Data Type

I am creating one Google Fit compatible App. My objective is to store Google Fit data using HistoryApi, and provide kind of Back Up- Restore functionality to user. If user buys new Android devices then he/she should be able to BackUp(sync) old data using his/her account.
I need to use Custom Data Type, as Public Data Types doesn't meet my requirements.
Everything works perfect, I am able to insert data and read data using History Api.
But When I try to read data from Another Android device using same Google Account then data is not available to read there.
My problem seems similar to this Custom DataTypes not synching between devices
This statement from Google Fit Document is not clear to me.
Custom data types are not available to use in other apps. Only the app
that creates a custom fitness data type can use it
source : CustomDataType
Q-1) What does it really means ? If I have an app GoogleFitDemo installed on multiple Android devices, then is it possible to sync data between this same app between multiple Android devices ?
Q-2)Is it improper way to store and backup data using Google fit ?
Update:
Finally, I found that Custom Data Type can also be synced normally, same as other Public Data Types. I had the sync issue as mentioned by #Ifor. Sync functionality is still buggy. In some scenarios sync stops working, and sometimes synced data is inconsistent across multiple devices.
1). My understanding is that same app same account but different devices it should work. Having said that sync is notoriously slow (hours days...) and has been buggy so it may be hard to tell if you have it right or not.
2) There are better backup methods... But if the data fits in with the rest of the stuff Google Fit is about and is not too big then it's probably ok.

Android changeable database content via internet? (like news apps)

Hello I am beginner to Android development so I want to ask how to create dynamically changeable database (content) in Android?
I'm aware of sqlite shared preferences but how can I interact with them via internet and add new information like news apps? Could Parse help?
This is not a answer, but a comment rather, I don't have the 50 rep required to comment.
It all depends on the sort of functionality you want to achieve. I.e. do you want to be able to push new content to the device using the internet such as push notifications.
OR
Do you want the app to make a http connection to a api or your own news service on startup or on button press for example?
UPDATE
Ok you have decided you want something similar to option 2. I am not going to write code for you but I will point you in the right direction and if you get stuck, post a question.
Please take a look at:-
https://play.google.com/store/apps/details?id=com.rsoftware.news
If you have decided this is what you want or similar, this application uses an API calling infrastructure.
The API they use is called FAROO.
http://www.faroo.com/hp/api/api.html
I suggest reading the documentation, deciding if this is indeed what you want, then sign up and get a API key. Afterall it is free! enjoy coding, enjoy the errors that you will receive and persevere =).
How to make a API call
I suggest when using a API, test the queries through the browser first of all or use something like Runscope for testing their services. So first get their URL which is:-
http://www.faroo.com/api
If we were to go to this url we will get a 401 response code, which means unauthorised. This is because we haven't added our unique API key to the html query. So this url can take parameters. We simply append a ? to the end of the url and supply the parameters that FAROO offers such as:-
q which stands for query (what do you want FAROO to search for?)
start which is the number it should start from
length which is the number of results you want FAROO to return
key which is your unique to make the requests
etc etc...
So an example of a complete url would be:-
http://www.faroo.com/api?q=iphone&start=1&length=10&l=en&src=news&f=json
This url is for demonstration purposes... your own url will have a key=YourAPIKey
Also notice how the parameters are separated by & symbols i.e. q=iphone&start=1 so this part q we know stands for query which is iphone & start=1 & so on.
Hope this helps.

sending information and getting response in android

In my app i need something like that.In my app a user can easily be a member by signing up.Now when a user become a member then he can communicate with other members.Suppose a want to send a message(same message) to all users, same location as he is.Or it may be something like that a user want to send a message(same message) to another 5 users whom he knows.
How can i do that.
I googled may times.I thought web-service can do that job.But i didn't right way to do that.
Can anyone how can i do that with references ???
You can refer following:
Simple PHP With MySQl(To get basics, No Interaction with Android)
http://davidwalsh.name/web-service-php-mysql-xml-json
One Demo:(Interaction with Android)
http://www.codeproject.com/Articles/267023/Send-and-receive-json-between-android-and-php
Good Tutorial:(Interaction with Android)
part1-http://guruparang.blogspot.in/2012/11/connect-android-and-mysql-via-php.html
part2-http://guruparang.blogspot.in/2012/12/connect-android-and-mysql-via-php.html
Best Tutorial (Here u can get All the idea):
http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
Use parse.com
Download the sample app. The sample app works both locally in Android and on the server-side. It does the hardest part for you.
Just modify it to make it fit your needs.

Categories

Resources