Android Question how to run TWA activity

mzsoft

Member
How can i run this code in b4a (Trusted web activity).


B4X:
 <activity
        android:name="com.google.androidbrowserhelper.trusted.LauncherActivity">

        <!-- Edit android:value to change the url opened by the TWA -->
        <meta-data
            android:name="android.support.customtabs.trusted.DEFAULT_URL"
            android:value="https://YOUR_SITE_URL" />

        <!--
          This intent-filter allows the TWA to handle Intents to open
          YOUR_SITE_URL
        -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE"/>

            <!-- Edit android:host to handle links to the target URL-->
            <data
                android:scheme="https"
                android:host="YOUR_SITE_URL"/>
        </intent-filter>
    </activity>


B4X:
Intent intent = new Intent(this, com.google.androidbrowserhelper.trusted.LauncherActivity.class);
intent.setData(Uri.parse("ANOTHER_SITE_URL"));
startActivity(intent);

and i dont know how to set implementation .
B4X:
implementation 'androidx.browser:browser:1.0.0'
implementation 'com.github.GoogleChrome:android-browser-helper:ff8dfc4ed3d4133aacc837673c88d090d3628ec8'
 

mzsoft

Member
i add.
B4X:
#AdditionalJar :browser-1.4.0.aar
#AdditionalJar :androidbrowserhelper-2.3.0.aar

and

B4X:
Dim i As Intent
    i.Initialize("com.google.androidbrowserhelper.trusted.LauncherActivity.class","www.google.com")
    StartActivity(i)

but get this error at compile.

B4X:
Convert byte code - dex.    Error
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)

please help me?
 
Upvote 0
Top