+ Android Componets team who work on the Reference Browser. On Fri, May 8, 2020 at 12:22 AM Bob Achgill <bobachg...@hotmail.com> wrote:
> Agi, > > The [1]: https://github.com/mozilla-mobile/reference-browser > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmozilla-mobile%2Freference-browser&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430767742&sdata=l4l%2Bvw%2B1mpS5lQD40oy7SxSNZluKrRYJ7%2B0pZSSKFKo%3D&reserved=0> > works great! It does tabs, Full screen video. It saves the tabs on > reopening. > > 1) Can you point me to where I can put in my start html local path when > the first tab and subsequent tabs are initiated? > > And... > > 2) How can I hide the triple vertical dot menu from being seen by the user? > > I know that sounds crude but it serves my near term need of getting our > html video intensive curriculum out to students out of school due to > Covid-19 school closure. The good news for Mozilla is that in short order > you will get a lot of testing done across a large number of devices across > the developing world for the mainline part of your reference-browser. The > fact that I will not touch the inner workings of your code base of the > reference-browser will mean that when I pass back an issue that a student > mentions you can be more sure of how your code is responding on other lower > versions of Android. > > Thanks! > > Bob Achgill > www.HisHandsReader.org > > ------------------------------ > *From:* Agi Sferro <asfe...@mozilla.com> > *Sent:* Wednesday, May 6, 2020 3:33 PM > *To:* Bob Achgill <bobachg...@hotmail.com> > *Cc:* mobile-firefox-dev@mozilla.org <mobile-firefox-dev@mozilla.org> > *Subject:* Re: GeckoView to help kids continue to learn at home in > lockdown in developing countries > > Hey Bob. > > I agree, getting an example to compile is a good first step. Unfortunately > we don't provide a version on github, but maybe we should. > > We have an example project on github that uses Android Components which > provides many reusable components on top of GeckoView [1] > > If you still want to build GeckoViewExample what you need to do is add a > root build.gradle file like this one that specifies topobjdir: [2] > change this line to refer to a released version of GeckoView: [3] > e.g. "org.mozilla.geckoview:geckoview-nightly:78.0.20200505094621" and > remove this line [4]. > > feel free to chat with us at > https://chat.mozilla.org/#/room/#geckoview:mozilla.org > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fchat.mozilla.org%2F%23%2Froom%2F%23geckoview%3Amozilla.org&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430757750&sdata=u9uXWTaTqSkIpdmZd17b2f1AnEMIqKDmGDDvG2b1yOY%3D&reserved=0> > > Cheers, > > [1]: https://github.com/mozilla-mobile/reference-browser > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmozilla-mobile%2Freference-browser&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430767742&sdata=l4l%2Bvw%2B1mpS5lQD40oy7SxSNZluKrRYJ7%2B0pZSSKFKo%3D&reserved=0> > [2]: > https://github.com/mozilla-mobile/gradle-apilint/blob/master/build.gradle > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmozilla-mobile%2Fgradle-apilint%2Fblob%2Fmaster%2Fbuild.gradle&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430777738&sdata=TQbcSwbWrs50jrnD3a4o%2BWFR6Nljlxh2%2F3%2FxT0nOOq4%3D&reserved=0> > [3]: > https://searchfox.org/mozilla-central/rev/dc4560dcaafd79375b9411fdbbaaebb0a59a93ac/mobile/android/geckoview_example/build.gradle#56 > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsearchfox.org%2Fmozilla-central%2Frev%2Fdc4560dcaafd79375b9411fdbbaaebb0a59a93ac%2Fmobile%2Fandroid%2Fgeckoview_example%2Fbuild.gradle%2356&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430787733&sdata=foR32KHDCA98eJH342wygcvAoDuuCU1xqWsJq52x9CE%3D&reserved=0> > [4]: > https://searchfox.org/mozilla-central/rev/dc4560dcaafd79375b9411fdbbaaebb0a59a93ac/mobile/android/geckoview_example/build.gradle#5 > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsearchfox.org%2Fmozilla-central%2Frev%2Fdc4560dcaafd79375b9411fdbbaaebb0a59a93ac%2Fmobile%2Fandroid%2Fgeckoview_example%2Fbuild.gradle%235&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430797735&sdata=5YYzxWwyP4D4Bi6v7fAZMhJDVmiN12cEGZVyK06nhpY%3D&reserved=0> > > On Wed, May 6, 2020 at 12:30 PM Bob Achgill <bobachg...@hotmail.com> > wrote: > > Thanks Agi! > > I will look through the Example. > > It would be good if i could get the Example to compile so i can see how > each feature looks. I could not find a GitHub version of the Example to > download... so i tried copying each activity, manifest, layout, and gradle > and recreating a AS project Example. But when I run it i get an error. > Doing all that by hand I probably missed something. > > If there is no better way to get a copy of the Example... can you suggest > what i may have missed by looking at the error? > > Caused by: groovy.lang.MissingPropertyException: Could not get unknown > property 'topobjdir' for project ':app' of type org.gradle.api.Project. > > Thanks! > Bob Achgill > > ------------------------------ > *From:* Agi Sferro <asfe...@mozilla.com> > *Sent:* Tuesday, May 5, 2020 12:09 PM > *To:* Bob Achgill <bobachg...@hotmail.com> > *Cc:* mobile-firefox-dev@mozilla.org <mobile-firefox-dev@mozilla.org> > *Subject:* Re: GeckoView to help kids continue to learn at home in > lockdown in developing countries > > > you're trying to create a GeckoRuntime > > This should read: you're trying to re-create a GeckoRuntime, in essence > you can only create the runtime in a given process once. When rotating > Android re-uses the process of your app and re-runs the initialization > code, causing the runtime to be created a second time. > > On Tue, May 5, 2020 at 10:07 AM Agi Sferro <asfe...@mozilla.com> wrote: > > Hi Bob, that's pretty cool! > > GeckoView should support Android 4.1 (API level 16) for all versions, > however we don't test on that version, so you might encounter bugs. > > The crash on rotation is probably due to the fact that you're trying to > create a GeckoRuntime in the same process, you can deal with this using a > static variable for the runtime, see [1]. > > GeckoViewExample (code linked above) supports tabs, you can get an idea > how to implement that from reading the code. In essence you would create a > `GeckoSession` for each tab and then call `geckoView.setSession(session)`, > see also [2]. > > [1]: > https://searchfox.org/mozilla-central/rev/7908ce29657cfd623993046bd8e38664e1c0b28e/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java#377 > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsearchfox.org%2Fmozilla-central%2Frev%2F7908ce29657cfd623993046bd8e38664e1c0b28e%2Fmobile%2Fandroid%2Fgeckoview_example%2Fsrc%2Fmain%2Fjava%2Forg%2Fmozilla%2Fgeckoview_example%2FGeckoViewActivity.java%23377&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430807729&sdata=YgyahsQEnd3xo27ztYxrkcw4D2951%2FeCKVfrmzzo35Q%3D&reserved=0> > [2]: > https://searchfox.org/mozilla-central/rev/7908ce29657cfd623993046bd8e38664e1c0b28e/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java#1030-1041 > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsearchfox.org%2Fmozilla-central%2Frev%2F7908ce29657cfd623993046bd8e38664e1c0b28e%2Fmobile%2Fandroid%2Fgeckoview_example%2Fsrc%2Fmain%2Fjava%2Forg%2Fmozilla%2Fgeckoview_example%2FGeckoViewActivity.java%231030-1041&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430817720&sdata=b2nepbSCwD5zHlgV41jfa%2B3SH4m6iBYw%2Bhexk4o%2BTjY%3D&reserved=0> > > On Tue, May 5, 2020 at 7:06 AM Bob Achgill <bobachg...@hotmail.com> wrote: > > Hello GeckoView developers/users, > > I am new to Java and GeckoView and have a few questions. My use case is > ... > There are presently 1.5 billion children out of school due to C19. > I am making a quick Geckoview app that they can use to continue to learn > from home on their family smart phone. Think Jelly Bean on up. > I already 1.8 GB mother tongue html video curriculums that we have been > using firefox for them to locally browse the curriculum. > Here is where GeckoView comes in... it will be much easier for families to > use an app integrated with the html viewing built in. > > Here are my hurdles to getting GV going in my app > 1) On both 70.0.20190712095934 and 77.0.20200421094220 my S7 GV crashes > when turning the phone between portrait and landscape. That seems like I > must be doing something really wrong with setting up the GV session? (see > my activity below) > > 2) I have some clients on 4.1. Is there a way of knowing which builds of > GV support which min SDKs? Is there a way to tweak GV to get down to > support 4.1? > > 3) What is the code I add to support tabs? Siblings in the same home then > can use their own tab view after brother does his homework with no > complaints. > > > Thanks so much! > Bob Achgill > > PS You can see from my code that I commented out lines in trying to set > up the settings. There is not much in the way of examples to follow that I > just didn't get AS giving me complaints on so i had to // them out. So > please feel free to add to my humble attempts! Your inputs will help kids > around the world start getting productive this week. :) > ~~~ > > package org.hishandsreader.mygeckoview; > > import androidx.appcompat.app.AppCompatActivity; > > import android.os.Bundle; > import android.view.View; > import android.view.WindowManager; > > // GeckoView > https://mozilla.github.io/geckoview/consumer/docs/geckoview-quick-start.html > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmozilla.github.io%2Fgeckoview%2Fconsumer%2Fdocs%2Fgeckoview-quick-start.html&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430827715&sdata=nfLlrsIs79bpaF%2BWg7oFwRsUPU6sBb9OAWC5JClZ2GM%3D&reserved=0> > import org.mozilla.geckoview.GeckoRuntime; > import org.mozilla.geckoview.GeckoRuntimeSettings; > import org.mozilla.geckoview.GeckoSession; > import org.mozilla.geckoview.GeckoSessionSettings; > import org.mozilla.geckoview.GeckoView; > > > > > > public class MainActivity extends AppCompatActivity { > > private GeckoView geckoview; > private GeckoSession geckoSession; > private GeckoRuntime geckoRuntime; > // test > private boolean mCanGoBack; > > @Override > protected void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.activity_main); > > // GeckoView > https://mozilla.github.io/geckoview/consumer/docs/geckoview-quick-start.html > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmozilla.github.io%2Fgeckoview%2Fconsumer%2Fdocs%2Fgeckoview-quick-start.html&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430837720&sdata=MEMlkK6hQuVEVFhDepym%2F%2Fjt2p2zmQg6MYQN8pq%2FPBU%3D&reserved=0> > GeckoView view = findViewById(R.id.geckoview); > > geckoSession = new GeckoSession(); > > //geckoSession.getSettings().setBoolean(GeckoSessionSetttings.USE_MULTIPROCESS, > true); > > //geckoSession.getSettings().setBoolean(GeckoSessionSetttings.USE_DESKTOP_MODE, > false); > > GeckoRuntimeSettings.Builder builder = new > GeckoRuntimeSettings.Builder() > .javaScriptEnabled(true) > //// .nativeCrashReportingEnabled(true) > .consoleOutput(true); > > geckoRuntime = GeckoRuntime.create(MainActivity.this, > builder.build()); > > ////geckoview.setSession(geckoSession geckoRuntime); > > geckoSession.open(geckoRuntime); > view.setSession(geckoSession); > > > //geckoSession.loadUri( "https://exploitrme.wordpress.com/ > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fexploitrme.wordpress.com%2F&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430847705&sdata=zwtKFYqFUE4tBNjW7TmbmITX%2FpMbijLJg3mQgwvS8M4%3D&reserved=0> > "); > > //https://github.com/mozilla-mobile/android-components/issues/5968 > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmozilla-mobile%2Fandroid-components%2Fissues%2F5968&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430857699&sdata=sIQ%2Fd6iMoUfd6UHRnr%2F8VSfnLkDOHDIUlNDzn4wd0eI%3D&reserved=0> > > geckoSession.loadUri("resource://android/assets/www/HHR-Learn2Read.html"); > //TODO Pixel api 19 never online > //TODO Pixl 29 shows app but no html > //TODO Bobs S7 works!! Backbutton works! > //TODO get help try to understand this to sper backbutton? > https://qiita.com/YusukeIwaki/items/3c25f7b73650c87180ba > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fqiita.com%2FYusukeIwaki%2Fitems%2F3c25f7b73650c87180ba&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430867696&sdata=dgpIyPQ4ITfztYyrbZOhKzXJeh2odQPTLW59gR1Kc9A%3D&reserved=0> > > // In Japanese > https://qiita.com/YusukeIwaki/items/3c25f7b73650c87180ba > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fqiita.com%2FYusukeIwaki%2Fitems%2F3c25f7b73650c87180ba&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430877689&sdata=fY6%2F302drCO2PzGIgZRouqI%2BuB9mYZ%2BAkjCoW4hMo0U%3D&reserved=0> > // @Override > //public void onBackPressed() > //{ > // session.goBack(); > //} > > > } > > @Override > public void onBackPressed() { > //if (geckoSession.canGoBack()) { > geckoSession.goBack(); > //} else { > // super.onBackPressed(); > //} > } > > > > // Does not appear to be doing anything. > public void onFullScreen(GeckoSession geckoSession, boolean > fullScreen) { > if (fullScreen) { > > getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); > > getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE > | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION > | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN > | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION > | View.SYSTEM_UI_FLAG_FULLSCREEN > | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); > } else { > > getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); > > getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE > | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); > geckoSession.exitFullScreen(); > } > } > } > > > _______________________________________________ > mobile-firefox-dev mailing list > mobile-firefox-dev@mozilla.org > https://mail.mozilla.org/listinfo/mobile-firefox-dev > <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.mozilla.org%2Flistinfo%2Fmobile-firefox-dev&data=02%7C01%7C%7C0525ae4bad48421ca40508d7f1fcd028%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637243940430887685&sdata=uee%2FWUhlWDvUeBlVKgPQL8tmrP%2B8ug48t6RdCLVMVtk%3D&reserved=0> > >
_______________________________________________ mobile-firefox-dev mailing list mobile-firefox-dev@mozilla.org https://mail.mozilla.org/listinfo/mobile-firefox-dev