Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernize codebase #68

Open
5 tasks done
hburgund opened this issue Oct 3, 2017 · 7 comments
Open
5 tasks done

modernize codebase #68

hburgund opened this issue Oct 3, 2017 · 7 comments
Assignees

Comments

@hburgund
Copy link
Member

hburgund commented Oct 3, 2017

  • Google Map not displayed on Speak - Thank You screen -> Due to not using debug Google Maps API key. The landmarking app is already configured with the release key.
  • legal notice menu option (open source licenses) is not working
  • out-of-range message is not displayed (must display user_message if returned when requesting stream)
  • Listen and Speak filter web view doesn’t use full width when opened 2nd time -> Halsey will have a look at this.
  • Home - i info button open browser app chooser dialog, doesn’t put content in dedicated view
  • Compile with TargetSDK > 22 will require implementing run time permissions (location, recording, storage) -> Decided to leave at TargetSDK == 22 for now.
  • Android actionbar displayed on Home screen. Why not full screen? (Do need the menu options though) -> Decided to keep action bar (since the menu is needed) for how.
@robknapen
Copy link
Contributor

Working on adding back the (required) legal notices, as per: https://developers.google.com/android/guides/opensource. However this throws the following exception:

Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.support.v7.app.AppCompatDelegateImplBase.onCreate(AppCompatDelegateImplBase.java:124)
at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:146)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:59)
at com.google.android.gms.oss.licenses.OssLicensesMenuActivity.onCreate(Unknown Source)

Updated base style in rwapp/res/values/styles.xml to:

<style name="AppBaseTheme" parent="Theme.AppCompat">

And set main activity theme to android:theme="@style/Theme.AppCompat.Light.DarkActionBar" > (for now) in AndroidManifest.xml of app, but still does not work properly. Needs some more tinkering.

@robknapen
Copy link
Contributor

robknapen commented Oct 9, 2017

Tried to have RwBoundActivity inherit from AppCompatActivity, but this breaks other things. Have to find another way to deal with displaying open source licenses information.

The easiest is probably to have our own text with the proper notices about the open source libraries used. For now this includes Roundware, the Picasso library (http://square.github.io/picasso/), and Google Play Services for the maps and location (and ExoPlayer? Anything else?). Have to figure out what text to use though.

@hburgund Any thoughts on this one?

PS: Found this https://medium.com/@jokatavr/how-to-use-android-open-source-notices-299a0635b5c2 which gets it to work (without having to change everything to AppCompat). However the list of licenses it shows is empty :( So apparently the POMs of the libraries included by the Gradle build files do not follow the standard for mentioning the license information.

@robknapen
Copy link
Contributor

robknapen commented Oct 9, 2017

The issue with the Home - Info button opening a browser to display the information probably is caused by the https redirect. In strings.xml the resource is listed as:

<string name="app_info_url">http://halseyburgund.com/dev/lm/app/info.html</string>

Opening this URL in a browser redirects it to https://... On Android in the app the webview loads the regular (http) URL, but is not setup to handle the redirect so Android wants to open a browser to deal with it (regular Android behaviour).

A simple fix is to setup the webview (in RwMainActivity) so that it loads all opened URLs into itself:

// setup the info webview so that it keeps http redirects from opening a browser
mInfoWebView = (WebView)findViewById(R.id.infoWebView);
mInfoWebView.setWebViewClient(new WebViewClient() {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
 });

However all links in the info webpage will then also be opened in the webview.

@hburgund
Copy link
Member Author

hburgund commented Oct 9, 2017

If I understand correctly, this seems like a fine solution for now. We don't need the ability to load urls linked in the info screen anywhere other than the webview itself. This is what you are saying, yes?

@robknapen
Copy link
Contributor

Yes it is. Although I noticed that the info content for Landmarking contains links to Flikr for some of the photo's used. Clicking those opens the Flikr website, which has a download link for the Flikr app, which attempts to open the Google Play Store (app), which ends in a weird error message in the (Info) webview. So safest then if you remove all hyperlinks from the info web content.

@robknapen
Copy link
Contributor

Cause of the Google Map not working probably related to running in the Android Emulator (have to install Google Play Services), and different debug and release Google maps API keys required (no Build Variants defined).

@hburgund
Copy link
Member Author

I can make sure only links that open up reasonably well are included in the info screen, no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants