How to set chart parameter in YouTube Data API v3( JAVA / Android) - android

Hi here is my code to get videos list.
YouTube.Videos.List listVideosRequest = youtube.videos().list("snippet, contentDetails");
listVideosRequest.setKey(apiKey);
I am not able to find a way to set chart parameter( one of the Filter option ). Actually i wanna retrieve videos list of Most popular in my region. Thanks in advance

Try like this.
First check whether you included proper lib or not in your project. Because some times it may not show all methods. for updated library click here.
Once you have updated library then
YouTube.Videos.List listVideosRequest = youtube.videos().list("snippet, contentDetails");
listVideosRequest.setChart("mostPopular");
listVideosRequest.setKey(apiKey);

Related

Android highcharts library chart loading completed listener event

I am new to Highcharts. I want to know when the data loading gets completed on android highcharts chart. Is there some listener available for the same? On search I could find only highcharts web related solutions.
Thanks in advance.
You need to assign the HIEvents object to the chart. In this object you can define a few features, like the load callback.

Changing SymbolLayer properties on click when using a VectorSource

I've been following this guide provided by Mapbox to familiarize myself with SymbolLayers and how to manipulate their properties on the map.
https://blog.mapbox.com/a-guide-to-the-android-symbollayer-api-5daac7b66f2c
The key step I'm having issues with is Step 5 where they update the iconSize property onMapClick. After they add a property to the selected Feature, the guide says to call source.setGeoJson(featureCollection); in order to reset the source of the layer.
The project I'm working with uses a VectorSource as the source of data for the SampleLayer, not a GeoJsonSource like the example uses. The problem is that VectorSource doesn't provide a method like setGeoJson so I'm not able to reset the layer source after I change the property.
What can I do to work around this without having to change all of our source data?
for (Feature feature : featureCollection.getFeatures() {
if (feature.getStringProperty("title").equals(selectedFeature.getStringProperty("title"))) {
feature.getProperties().addProperty("selected", true);
}
}
source.setGeoJson(featureCollection);
The full source of that example can be found here: https://github.com/mapbox/mapbox-android-demo/blob/286f33d848c9fea48de908b144682081961b986b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/SymbolLayerMapillaryActivity.java
For anyone coming across this issue in the future, the only possible approach here would be to remove and add layer again, with the updated source. This is however an ineffective solution, so it would really be better for you to use GeoJson source instead.

Segmented Control in Android

We all know segmented control that is IOS but not in android. So I have an application that need something like that. For example let suppose I have a list of students and teacher marks the student either absent or present. and on click of each option there is a service call . for this I am using a library which is as follows:
compile 'info.hoang8f:android-segmented:1.0.6'
As I told you I have a list of students so in list I have the following case;
Case 1: If the teacher review the attendance the of last day , I fetch a list of students that are either absent or present. So on this , the segmented control that I am using in list fires the onCheckChangedlistener which run the code which is also performing some task , where as I only want to perform the task only when user change the listener. In short listener should not fire when I change any check pragmatically. and Also it fires the onCheckChangedListener multiple times. which creates problem for me :
So I have couple of question:
1) what can be used in android in place of the Segmented control library as I stated above.
2) what is possible workaround for this problem. I tried using flag but I am working in getview of listview.
this is a good library in response to what you achieve. I have used this and found the similar problem. So hence by putting flag , and making a raw check over it does a work for me . But As you are using list, i think you can not achieve what you are looking for.
I will suggest to use the radio button to get the check or you can make your custom control like this and see this library

get List of all activites listed in google fit

I need to get list of all activities listed in google fit just like google fit app .so that user can select a particular activity to insert them into the health kit . Is there any intent builder for achieving this . I read the FitnessActivites class Descripition and Fitness Doc too but did't get the solution .. Can anyone help me out .. i'm stuck here
You can actually get it form AndroidManifest file. Even if its compiled.
Therer is list copied from it (used Notepad++):
com.google.android.apps.fitness.FitnessActivity
com.google.android.apps.fitness.preferences.settings.SettingsActivity
com.google.android.apps.fitness.preferences.DebugSettingsActivity
com.google.android.apps.fitness.location.MapActivity
android.support.PARENT_ACTIVITY
com.google.android.apps.fitness.preferences.settings.SettingsEditor
com.google.android.apps.fitness.preferences.settings.activityeditor.ActivityEdior
com.google.android.apps.fitness.preferences.settings.BleDevicesActivity
com.google.android.apps.fitness.preferences.settings.BlePairingActivity

Android : droidar setting up POIs and show details on click

In my app i want to use augmented reality to show some predefined POIs . When user click on the POI object, i want to show more detail about that store / object.
As i was looking for free AR framework , i came across Droidar. I saw its wiki and samples and have got an idea about structure. I understood how to add POIs. I need help on making them as clickable and adding an event on click.
Please share any tutorials if you know.
Also what is the link for droidar documentations.
You could always attach a setOnClickCommand to your POI
poiObj.gObj.setOnClickCommand(new POIDisplayCommand(getActivity(), poiObj));
In the above case I have a POI object poiObj which has a GeoObj member gObj. By using the setOnClickCommand I have called a POIDisplayCommand which loads a new Activity which displays the details about the clicked POI. The POIDispplayCommand is a class that extends the commands.Command
If you need more on the above method you could always check the StaticDemoSetup.java in de.rwth.setups package of the DroidAR library in your IDE.

Categories

Resources