EDIT: See this instead https://www.b4x.com/android/forum/t...like-with-a-library-like-mainactivity.102965/
We are developing a replacement app on a device. the device has an SOS button on it. When the button is pressed the existing app on the phone is launched. We have permission from the Manufacturer (China) to install our own version of the app. The manifest file should look like this :
The problem we have is that in B4a the MainActivity is main, so when the button is pressed on the device our replacement app cannot be called. We engaged a Java consultant to look at this for us, and he developed a replacement sample as proof of concept and the above manifest is from his project that is wrote in Android Studio.
We want to keep all our code in b4a so we dont need to reply on a 3rd party for mods/changes. I have tried to add MainActivty and modified my manifest :
Any suggestions ?
Regards
John.
We are developing a replacement app on a device. the device has an SOS button on it. When the button is pressed the existing app on the phone is launched. We have permission from the Manufacturer (China) to install our own version of the app. The manifest file should look like this :
B4X:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.onekeysos">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<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=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".OneKeySosCountDownActivity"
android:label=""
android:theme="@style/Theme.Transparent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
The problem we have is that in B4a the MainActivity is main, so when the button is pressed on the device our replacement app cannot be called. We engaged a Java consultant to look at this for us, and he developed a replacement sample as proof of concept and the above manifest is from his project that is wrote in Android Studio.
We want to keep all our code in b4a so we dont need to reply on a 3rd party for mods/changes. I have tried to add MainActivty and modified my manifest :
B4X:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.onekeysos"
android:versionCode="5"
android:versionName="1.5.19.02.20.01a"
android:installLocation="internalOnly">
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<application
android:icon="@drawable/icon"
android:label="Atlas SOS Now"
android:supportsRtl="true"
android:theme="@style/DarkTheme">
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".main"
android:label="Atlas SOS Now"
android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".starter">
</service>
<receiver android:name=".starter$starter_BR">
</receiver>
<service android:name=".svc_intent">
</service>
<receiver android:name=".svc_intent$svc_intent_BR">
<intent-filter> <action android:name="android.intent.action.START_SLIDETO_SOSSERVICE"/></intent-filter>
</receiver>
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".mainactivity"
android:label="Atlas SOS Now"
android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Any suggestions ?
Regards
John.
Last edited: