How to launch an Android application when launching the PhoneGap application?

I created MainActivity, which extends Activity (also tried to extend CordovaActivity), and would like to show this action immediately after starting the PhoneGap application. The problem is that no matter what I try to configure in different configurations, etc., the manifest file is partially overwritten and the web view that loads www \ index.html is displayed.

I probably don't need many of the original PhoneGap features for this application, but I would like to use build.phonegap.com to create and deploy it.

Rewriting the Cordova web class class to get started with a new intention might be the solution I suppose, but should there be another (config) way around this?

AndroidManifest.xml (before build.phonegap.com):

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="1.0.0" android:windowSoftInputMode="adjustPan" package="com.mystuff.myapp" xmlns:android="http://schemas.android.com/apk/res/android">
        <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
        <uses-permission android:name="android.permission.INTERNET" />
        <application android:allowBackup="true" android:debuggable="true" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
            <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="com.mystuff.myapp.MainActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
        <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
    </manifest>

AndroidManifest.xml( build.phonegap.com, ManifestViewer):

<?xml version="1.0" encoding="utf-8"?>
    <manifest
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:versionCode="42"
        android:versionName="1.0.0"
        android:windowSoftInputMode="stateUnspecified|adjustPan"
        android:installLocation="auto"
        package="com.mystuff.myapp">
        <supports-screens
            android:anyDensity="true"
            android:smallScreens="true"
            android:normalScreens="true"
            android:largeScreens="true"
            android:resizeable="true"
            android:xlargeScreens="true"/>
        <uses-permission
            android:name="android.permission.INTERNET"/>
        <uses-permission
            android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <application
            android:label="@2130968576"
            android:icon="@2130837504"
            android:debuggable="true"
            android:hardwareAccelerated="true">
            <activity
                android:label="@2130968576"
                android:name=".MyApp"
                android:screenOrientation="unspecified"
                android:configChanges="locale|keyboard|keyboardHidden|orientation|screenSize"
                android:windowSoftInputMode="stateUnspecified|adjustUnspecified">
                <intent-filter>
                    <action
                        android:name="android.intent.action.MAIN"/>
                    <category
                        android:name="android.intent.category.LAUNCHER"/>
                </intent-filter>
            </activity>
            <activity
                android:label="@2130968576"
                android:name="com.phonegap.DroidGap">
                <intent-filter/>
            </activity>
        </application>
        <uses-sdk
            android:minSdkVersion="7"/>
    </manifest>
+4

Source: https://habr.com/ru/post/1527887/


All Articles