Problems with GoRouter deeplink paths when app is not deployt under root - flutter-web

I want to host an Flutter Web App under https://www.someDomain.com/someFolder/otherFolder
and create a deeplink like that https://www.someDomain.com/someFolder/otherFolder/showProducts/1
that should also work for smartphones.
In android I define:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="www.someDomain.com" android:path="/someFolder/otherFolder" />
</intent-filter>
So the deeplink is working for the webapp and the smartphone - BUT I would have to define a GoRoute like that:
GoRoute(
path: "**someFolder/otherFolder/**showProducts/:productID",
builder: _showProductsDL,
),
The problem is that a version of the WebApp could also be deployed under other subfolder structures like
https://www.someDomain.com/
or
https://www.someDomain.com/somewhereElse/V2/
or
https://www.someDomain.com/somewhereElse/v3/
Is it somehow possible to handle all by defininig a GoRoute with the path "showProducts/:productID" and ignore the subfolders / remoe them from the path the GoRouter is working with?

Related

Android Studio (Ionic Gradle) - App isn't installed after Building

Problem After building, running in Android-Studio-Emulator: "App isn't installed".
What to do?
--Android Studio 2020.3
--Android SDK 30, Tools 30.0.2
--Gradle 7.0.2
...
I fail to see any proper Log in the emulator, maybe it's just me but coming from XCode this Android Studio is very poorly built, too bad. Hope someone can help.
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.midix.finance">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:name="com.midix.finance.MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/custom_url_scheme" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/file_paths"></meta-data>
</provider>
</application>
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Camera, Photos, input file -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Geolocation API -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.location.gps" />
<!-- Navigator.getUserMedia -->
<!-- Video -->
<uses-permission android:name="android.permission.CAMERA" />
<!-- Audio -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
</manifest>
Android studio is not poorly built. You need to learn its UI/UX and its functions just like how you learnt xCode.
I recommend debug your app in physical device. So connect your phone to the computer using USB cable (USB debugging must be turned on in your device).
Your device name must show in the place where Pixel 2 API 30 showing in your Android Studio screen.
Click on play button next to the device. After gradle building, app will be installed on your device. Authenticate your installation in your phone (Something says "Install this app?") after clicking play button.
Open "Logcat" option at the bottom to see any serious error logs coming.
If your app not installed means search the Logcat with your App package name. It will show why app not installed. Post your Logcat error to get accurate solution.

Unable to create a new activity in Android Studio

I am working on a demo project for my Pluralsight training course, and am trying to do something as simple as adding a new activity through Android Studio UI. I right-click on the main folder under "Java" folder (normal android folder structure) and choose 'activity'...'navigation drawer activity'. I go through all the wizard steps, and the new entry gets made in the AndroidManifest.xml file. Yet, the UI resource xml file doesn't get created and kotlin .kt file doesn't get created, either. I have a Windows 10 machine and a Kubuntu 20.04 machine and have gotten this same behavior on both.
Here are the Android studio build details from my Kubuntu machine, which I use the most:
Android Studio 4.0.1
Build #AI-193.6911.18.40.6626763, built on June 24, 2020
Runtime version: 1.8.0_242-release-1644-b3-6222593 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.4.0-42-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 2014M
Cores: 4
Registry: ide.new.welcome.screen.force=true
Non-Bundled Plugins:
This is the AndroidManifest.xml file. the activity I am trying to add is called .ItemActivity. The IDE is underlining it in red, saying that I don't have the accompanying class file and the resource file in the project, but I already know that.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.notekeeper" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name=".ItemsActivity"
android:label="#string/title_activity_items"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".NoteListActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".NoteActivity"
android:label="#string/note_edit"
android:theme="#style/AppTheme.NoActionBar" />
</application>
</manifest>

How to open phonegap app from unique domain url?

I am trying to develop an app for my web site using phonegap. So I need to ask
'Would you like to open this link from app?'
When someone opens my web's url in app installed device like facebook urls. How can I do that?
I only had to google this: open cordova app from url
Took me 30 seconds at most.
You can add this onto your config.xml:
<preference name="AndroidLaunchMode" value="singleTask" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="example.com" android:scheme="http" />
</intent-filter>
As well as this onto your index.html:
function deviceReady() {
window.plugins.webintent.getUri(function(url) {
console.log("INTENT URL: " + url);
//...
});
}
window.plugins.webintent.onNewIntent(function(url) {
console.log("INTENT onNewIntent: " + url);
});
Note: This is not my code. Found it at how can cordova open app from http or https url?

ScreenSaver App for Android TV using DayDream Service- There was a problem in parsing the package

I am trying to make an app for Android Tv it is a screen saver app I am taking help from an official document from Google and this link
[https://android-developers.googleblog.com/2012/12/daydream-interactive-screen-savers.html]
Here is my manifest file the app is simply using DayDream Service to load the URL on WebView, if I install this app on my phone it works perfectly( am talking about the only installation, I still have a problem in running screen saver), but before that how do I resolve this error?
"There was an error in parsing the package"
<?xml version="1.0" encoding="utf-8"?>
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.software.leanback"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:banner="#drawable/app_icon_your_company"
android:icon="#drawable/app_icon_your_company"
android:label="#string/app_name"
android:logo="#drawable/app_icon_your_company"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<service
android:name="Screensaver"
android:exported="true"
android:label="WebView">
<intent-filter>
<action android:name="android.service.dreams.DreamService" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<activity
android:name="SetURL"
android:label="Dream URL"
android:theme="#android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<activity
android:name="SetURLInteractive"
android:label="Dream URL (Interactive)"
android:theme="#android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
</application>

Apportable app shows black screen

I made it to compile my app using apportable. However when running on device it just shows a black screen I have tried cleaning, reseting... etc. But no luck it just shows black screen, the project was done using XCode 5 and during the opengl selection I tried OpenGLES1/2(just in case), however no luck at all. Here's what apportable debug has to say:
warning: Breakpoint address adjusted from 0x40181b79 to 0x40181b78.
0x401e5408 in epoll_wait ()
from /Users/pabloivan57/.apportable/cache/devices/015d2ea4ce4c2208/libs/libc.so
$1 = 0
Breakpoint 1 at 0x6b7b01ac: file /Users/pabloivan57/Documents/Scopic Projects/Debrief/svn/Debrief/Debrief/main.m, line 3.
Breakpoint 2 at 0x62acf7b0
[New Thread 25402]
[Switching to Thread 25402]
Breakpoint 1, main (argc=0, argv=0x6b629c08 <_start_method>)
at /Users/pabloivan57/Documents/Projects/Deb/svn/Deb/Deb/main.m:3
3 int main(int argc, char *argv[]) {
And the manifest:
package="com.gcap.debrief"
android:sharedUserId="com.gcap.debrief"
android:installLocation="auto"
android:versionCode="1387670144"
android:versionName="1.0">
<supports-gl-texture android:name="GL_OES_compressed_ETC1_RGB8_texture" />
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.vending.BILLING" />
<supports-screens android:resizeable="true" android:normalScreens="true" android:largeScreens="true" android:smallScreens="false"/>
<application android:label="#string/app_name"
android:name="com.apportable.app.VerdeApplication"
android:hasCode="true"
android:icon="#drawable/icon"
android:theme="#style/FullScreenActivity"
android:debuggable="true"
android:largeHeap="false"
android:hardwareAccelerated="false"><meta-data android:name="android.app.libs" android:value="v cxx System objc pthread_workqueue dispatch ffi Foundation freetype CoreGraphics BridgeKit CoreText OpenAL verde" />
<meta-data android:name="android.app.lib_name" android:value="verde" />
<meta-data android:name="android.app_name" android:value="Debrief" />
<meta-data android:name="apportable.splash_screen_type" android:value="letterbox" />
<meta-data android:name="apportable.orientation" android:value="portrait" />
<meta-data android:name="apportable.opengles2" android:value="true" />
<meta-data android:name="apportable.opengles.fast_color" android:value="true" />
<meta-data android:name="apportable.abi_list" android:value="" />
<activity android:name="com.apportable.activity.VerdeActivity"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:enabled="true" android:name="com.apportable.activity.GdbServerService"
android:label="#string/app_name" android:icon="#drawable/icon">
<intent-filter >
<action android:name="com.gcap.debrief.GdbServerService" />
</intent-filter>
</service>
<service android:name="com.apportable.media.AudioManagerService" android:exported="false" />
<service android:name="com.apportable.iap.BillingService" />
<receiver android:name="com.apportable.iap.BillingReceiver">
<intent-filter>
<action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
<action android:name="com.android.vending.billing.RESPONSE_CODE" />
<action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
</intent-filter>
</receiver>
</application>
Please let me know if you need anything else, help here is greatly appreciated.
Thanks
Apportable does not yet support xcode 5 xibs. They need to be saved in xcode 4 format. More background in this Apportable discuss thread.
If you still see a white screen, post the tail of adb logcat after the white screen comes up.

Resources