Fixed
Status Update
Comments
lm...@google.com <lm...@google.com>
br...@google.com <br...@google.com>
mi...@gmail.com <mi...@gmail.com> #2
Was there any changes that came out of this issue? 542653 characters to display as legal attribution seems absolutely absurd. If this does indeed need to be included in an application using the Maps API, what is the best practice to display the text? The phones I'm using freeze up for multiple seconds when placing the string in a text view.
kc...@gmail.com <kc...@gmail.com> #3
A URL link would be highly appreciated until a fix is released. Otherwise attributing the project would create fatal performance issues in our apps.
sj...@gmail.com <sj...@gmail.com> #4
This is definitely problematic - you effectively can't obey the Google Maps v2 Terms of Use without locking up your UI for 7-9 seconds. The call to TextView.setText() is what causes the freeze, and you can't update the UI from a background thread (e.g., AsyncTask), so you're stuck with the freeze.
If you're looking for code that reproduces this, take a look at our open-source app here:
https://github.com/OneBusAway/onebusaway-android/tree/aboutFreezeDemo
Run with:
gradlew installObaGoogleDebug
Or just download the app from Google Play (still freezes as of v2.1.2):
https://play.google.com/store/apps/details?id=com.joulespersecond.seattlebusbot
Browse to "Settings->About", and wait 7-9 seconds for it to load.
Here is the Activity that calls getOpenSourceSoftwareLicenseInfo() in onCreate():
https://github.com/OneBusAway/onebusaway-android/blob/aboutFreezeDemo/onebusaway-android/src/main/java/org/onebusaway/android/ui/AboutActivity.java
I've tried using a Handler with postdelayed() to avoid blocking onCreate(), but that doesn't have any effect. The problem is with TextView.setText() with that big of a String.
7-9 second latency is from ~10 benchmark runs on a stock LG G4 w/ Android 6.0, using another device stopwatch app to benchmark. Full device details below.
Test device: LG G4
Model: LGLS991
OS Version: Android 6.0 / API Level 23
Google Play Services App: 9.4.52 (440-127739847)
Google Play Services Library: 9452000
If you're looking for code that reproduces this, take a look at our open-source app here:
Run with:
gradlew installObaGoogleDebug
Or just download the app from Google Play (still freezes as of v2.1.2):
Browse to "Settings->About", and wait 7-9 seconds for it to load.
Here is the Activity that calls getOpenSourceSoftwareLicenseInfo() in onCreate():
I've tried using a Handler with postdelayed() to avoid blocking onCreate(), but that doesn't have any effect. The problem is with TextView.setText() with that big of a String.
7-9 second latency is from ~10 benchmark runs on a stock LG G4 w/ Android 6.0, using another device stopwatch app to benchmark. Full device details below.
Test device: LG G4
Model: LGLS991
OS Version: Android 6.0 / API Level 23
Google Play Services App: 9.4.52 (440-127739847)
Google Play Services Library: 9452000
ko...@gmail.com <ko...@gmail.com> #5
currently, I'm using ListView to display this horrendous amount of legalese.
I split the text into array and pump them into a ListView.
I split the text into array and pump them into a ListView.
sj...@gmail.com <sj...@gmail.com> #6
@kohan what delimiter are you using to split the text? And could you share a screenshot of your ListView solution?
ve...@gmail.com <ve...@gmail.com> #7
While I agree that the performance is abysmal, there is no need to lock up the UI.
A layout including a progress bar and scrollview:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android " android:id="@+id/layoutView" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<ProgressBar android:id="@+id/progressBar" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/progressBar" />
<ScrollView android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="match_parent" android:fadeScrollbars="false" android:paddingTop="8dp">
<TextView android:id="@+id/textMessage" android:layout_height="wrap_content" android:layout_width="match_parent" style="@style/labelTerms" android:paddingLeft="16dp" android:paddingRight="16dp" />
</ScrollView>
</LinearLayout>
where txtMessage = the TextView, and progressBar = the ProgressBar:
new ReadGPSTask(getActivity(), txtMessage, progressBar).execute();
//-------------------------------------------------------------------------
// AsyncTask Read Google Play Services
//-------------------------------------------------------------------------
private class ReadGPSTask extends AsyncTask<Void, Integer, Void>
{
Activity activity;
TextView textView;
ProgressBar progressBar;
StringBuilder bufferEula = null;
public ReadGPSTask (Activity a, TextView tv, ProgressBar pb)
{
activity = a;
textView = tv;
progressBar = pb;
}
@Override
protected void onPreExecute()
{
progressBar.setVisibility(View.VISIBLE);
textView.setText(activity.getResources().getString(R.string.loading));
return;
}
@Override
protected Void doInBackground(Void... params)
{
try
{
bufferEula = new StringBuilder();
publishProgress(20);
// Google Play Services attribution
try
{
switch (GooglePlayServicesUtil.isGooglePlayServicesAvailable(activity))
{
case ConnectionResult.SUCCESS:
case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
case ConnectionResult.SERVICE_DISABLED:
bufferEula.append(GoogleApiAvailability.getInstance().getOpenSourceSoftwareLicenseInfo(activity));
break;
}
}
catch (Exception e)
{
}
}
catch (Exception e)
{
}
finally
{
}
return(null);
}
@Override
protected void onPostExecute (Void result)
{
progressBar.setVisibility(View.GONE);
textView.setText(bufferEula);
}
@Override
protected void onProgressUpdate(Integer... progress)
{
progressBar.setProgress (progress[0]);
}
}
this gives the user a progress bar while loading the content. Of course this would be even better if the content loads much quicker!
A layout including a progress bar and scrollview:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="
<ProgressBar android:id="@+id/progressBar" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/progressBar" />
<ScrollView android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="match_parent" android:fadeScrollbars="false" android:paddingTop="8dp">
<TextView android:id="@+id/textMessage" android:layout_height="wrap_content" android:layout_width="match_parent" style="@style/labelTerms" android:paddingLeft="16dp" android:paddingRight="16dp" />
</ScrollView>
</LinearLayout>
where txtMessage = the TextView, and progressBar = the ProgressBar:
new ReadGPSTask(getActivity(), txtMessage, progressBar).execute();
//-------------------------------------------------------------------------
// AsyncTask Read Google Play Services
//-------------------------------------------------------------------------
private class ReadGPSTask extends AsyncTask<Void, Integer, Void>
{
Activity activity;
TextView textView;
ProgressBar progressBar;
StringBuilder bufferEula = null;
public ReadGPSTask (Activity a, TextView tv, ProgressBar pb)
{
activity = a;
textView = tv;
progressBar = pb;
}
@Override
protected void onPreExecute()
{
progressBar.setVisibility(View.VISIBLE);
textView.setText(activity.getResources().getString(R.string.loading));
return;
}
@Override
protected Void doInBackground(Void... params)
{
try
{
bufferEula = new StringBuilder();
publishProgress(20);
// Google Play Services attribution
try
{
switch (GooglePlayServicesUtil.isGooglePlayServicesAvailable(activity))
{
case ConnectionResult.SUCCESS:
case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
case ConnectionResult.SERVICE_DISABLED:
bufferEula.append(GoogleApiAvailability.getInstance().getOpenSourceSoftwareLicenseInfo(activity));
break;
}
}
catch (Exception e)
{
}
}
catch (Exception e)
{
}
finally
{
}
return(null);
}
@Override
protected void onPostExecute (Void result)
{
progressBar.setVisibility(View.GONE);
textView.setText(bufferEula);
}
@Override
protected void onProgressUpdate(Integer... progress)
{
progressBar.setProgress (progress[0]);
}
}
this gives the user a progress bar while loading the content. Of course this would be even better if the content loads much quicker!
th...@gmail.com <th...@gmail.com> #8
Google, will there be any updates to this issue? Client QA complains periodically about how slow this call is, but I really don't want to waste their time and money putting in a workaround for a bloated legal String request, especially when this issue can be fixed at source at any time, without requiring a new build from us.
Please do some simple text editing here. Make the result returned from getOpenSourceSoftwareLicenseInfo() a maximum of few kilobytes, with a summary of the legal attributions, and then provide a link referring people to the full text elsewhere online.
Please do some simple text editing here. Make the result returned from getOpenSourceSoftwareLicenseInfo() a maximum of few kilobytes, with a summary of the legal attributions, and then provide a link referring people to the full text elsewhere online.
br...@google.com <br...@google.com>
lm...@google.com <lm...@google.com> #9
Thanks for the reports of this issue. Good news. Users can now see all of the license information for Google Play Services by going to Android Settings > Google > Overflow menu > Open Source Licenses on their device. Since that is the case we have removed the attribution requirements for developers using the Google Maps Android API. You no longer have to call GoogleApiAvailability.getInstance().getOpenSourceSoftwareLicenseInfo() and show that text in your app.
fi...@gmail.com <fi...@gmail.com> #10
Thanks for the info. In that case shouldn't GoogleApiAvailability.getInstance().getOpenSourceSoftwareLicenseInfo() become deprecated? Or at least mention fact that call is no longer required in API reference. That would be great to have this stated clearly.
lm...@google.com <lm...@google.com> #11
Yes, the method will become deprecated in an upcoming release of Google Play Services, at which point the API reference will be updated accordingly.
In the meantime, we have removed the instructions to call this method from our Guides ondevelopers.google.com/maps/documentation/android-api/ .
In the meantime, we have removed the instructions to call this method from our Guides on
lm...@google.com <lm...@google.com> #12
The getOpenSourceSoftwareLicenseInfo() method in the GoogleApiAvailability class is now deprecated in Google Play Services 11.0.0.
See the updated reference doc here:
https://developers.google.com/android/reference/com/google/android/gms/common/GoogleApiAvailability.html#getOpenSourceSoftwareLicenseInfo(android.content.Context)
See the updated reference doc here:
ma...@marcardar.com <ma...@marcardar.com> #13
> we have removed the attribution requirements for developers using the Google Maps Android API
Please can you confirm there are also no attribution requirements for developers using other Google Play Services features (e.g. analytics)?
Please can you confirm there are also no attribution requirements for developers using other Google Play Services features (e.g. analytics)?
lm...@google.com <lm...@google.com> #14
That is correct Mark. The attribution requirements have been removed for the entirety of Googly Play Services.
Description
consider reducing this to text that is hyperlnked so that the interested user can click it and read the more detailed legalese?