Does the Google Fit API provide any flag to indicate the data was entered manually in the app.If yes, please suggest which needs to checked for that as the requirement is to process only the device collected data and not the manual entries in fitness apps.
Closest you can get to achieve is this to filter out the results provided by the google fit sdk based on the original data source attributes.
For example
dataset.dataPoints.forEach {
it.originalDataSource.appPackageName
it.originalDataSource.device
it.originalDataSource.name
}
Related
I want to get step value using google fit api and tried the example provided by google here. I could successfully implemented it and am able to retrieve history data (both today data and past data).
However, if I insert step value (from insert activity) manually to fit app, or integrated third party apps to the fit app, it will take all the step value (it will get the same value as what fit app shows).
I don't want the step value from user input neither from the third app.
Is it possible to separate the step value based on the data source if we use fit API.
*in fit FAQ page , it is written:
How do I query for available third-party or other data sources?
Today, this is only available via the REST API; this data is not yet available via the Android API.
so does it mean, we can not query the data from the sensor only?
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'm trying to save events from my app in the Google's calendar. Now, I'm using an intent to launch this preview screen (with the fields already filled in) in case the user wants to modify any field. I want to use the Google's calendar API, I have read the documentation and I have not found the way that this screen appears. Can someone give me a hand? Thank you.
The Google Calendar API is a rest api. It returns data in raw json format. It is up to the developer to format the data and display it as they would like.
I have read the documentation and I have not found the way that this screen appears.
The Google Calendar does not have access to any screens it only has access to data. You will have to create your own screens and extract the data from the Api.
Most of the data in that screen can be found in the event methods found in this section of the documentation events overview
Google maps allows the possibility of saving favourite locations for ease of access later... see here.
In Android, where a location is required to be entered, it would be neat if there were an API to enable the user to choose from their already-saved favourite locations, e.g. via a picker dialog or something along those lines.
I can't find such an API... is there? The closest I've found is this and this, but these don't seem to allow picking from your stored locations.
There really isn't a way to do this, but you could create your own method to do it. You could have an ImageButton with a star (or anything that symbolizes 'save'). Use SharedPreferences to save the latitudes and longitudes that the users have entered, and then every time the application is loaded up, you could check to see if there are some values in the SharedPreferences. If there are, you could use a ListView to show all the saved locations, and then when one is clicked, return to the parent activity with the Location. Finally, use the Location to orient the map correctly.
Google/Android doesn't provide any public API to access the starred/frequent locations of a user and that data is only shared amongst the Google apps.
As this answer shows it might be possible to fetch location data via the Google Plus and Google Identity platform APIs
Alternatively (or in addition to), using Google's Plus Platform /
Google Identity Platform, if you have an authenticated user, you can
make an API call as described here (with examples) to get any of the
specified fields for the current user (including currentLocation,
organizations (including work) with addresses, if the user provided
them).
Take a look at this link.
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.