how to start a MapActvity from Activity - android

i'm trying to start a map activity from a normal Activity.
But keep getting the error:
10-20 10:47:08.828: ERROR/dalvikvm(1102): Could not find class 'com.xxApp.MapAnalyseActivity', referenced from method com.xxApp.xxAppActivity$1.run
10-20 10:47:11.578: ERROR/AndroidRuntime(1102): java.lang.NoClassDefFoundError: com.xxApp.MapAnalyseActivity
when i try to do:
startActivity(new Intent(xxAppActivity.this, MapAnalyseActivity.class));
xxAppActivity.this.finish();
Here is my manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxApp"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".xxAppActivity" android:label="#string/app_name" android:theme="#style/xxTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/mapAnalyse" android:name="MapAnalyseActivity" android:configChanges="orientation|keyboardHidden" android:theme="#style/xxTheme">
<intent-filter>
<action android:name="com.xxApp.MapAnalyseActivity" />
</intent-filter>
</activity>
</application>

Your manifest.xml should look like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxApp"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".xxAppActivity" android:label="#string/app_name" android:theme="#style/xxTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/mapAnalyse" android:name="MapAnalyseActivity" android:configChanges="orientation|keyboardHidden" android:theme="#style/xxTheme"/>
<uses-library android:name="com.google.android.maps"/>
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

Check that MapActivity is in the Same Folder ?
or try giving full path in manifest as
com.packagename.mapactivity

Related

How to integrate AndroidManifest.xml?

So I need to integrate unity with android feature like connect to 3rd party app.
So I made .apk build after working at eclipse, but how to integrate between 2 AndroidManifest files?
First reference one is,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mygame.plugin"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="ka67492508561297" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.kakao.unity.plugin.ThirdPartyPostStoryActivity" android:windowSoftInputMode="stateAlwaysVisible" android:theme="#android:style/Theme.Translucent.NoTitleBar"/>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
and the main one my game currently uses is
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mygame.mygame1"
android:installLocation="preferExternal"
android:theme="#android:style/Theme.NoTitleBar"
android:versionCode="2"
android:versionName="1.01">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="22" />
<application
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name">
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="ka7492508561297" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="org.onepf.openiab.UnityProxyActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.ka.unity.plugin.ThirdPartyPostStoryActivity" android:windowSoftInputMode="stateAlwaysVisible" android:theme="#android:style/Theme.Translucent.NoTitleBar"/>
</application>
<uses-permission android:name="com.android.vending.BILLING"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.sec.android.iap.permission.BILLING"/>
<uses-permission android:name="org.onepf.openiab.permission.BILLING"/>
So I merged reference one to my main one like above,
But error says,
[UnityException: Unable to start activity!
No activity in the manifest with action MAIN and category LAUNCHER. Try launching the application manually on the device.]
I still can make .apk file, and can run on my phone, but can't connect to 3rd party app when in-game button touched that should launch connection.
So strange... how should I fix?
Thanks.

No launcher activity found while loading Application

This is what my AndroinManifest.xml looks like
<manifest package="com.dz122596.bubblebop"
android:versionCode="1"
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:icon="#drawable/ic_launcher" <!-- THIS ICON(IMAGE) WILL BE SHOWN IN YOUR APPS -->
android:label="#string/app_name" <!-- HERE LABEL(APP NAME) -->
<activity
android:name=".startingpoint" <!-- (.)dot means current dir, if your activity is in another package then give cull package name ex: com.xxx.Activity -->
android:label="#string/app_name"
android:screenOrientation="portrait"
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</manifest>
And startingpoint.java the activity Iam trying to launch is in the same package but when I run it says no launcher activity found.
Your manifest file's code says that your forgot to end the Application tag. You need to write </application> before </manifest> tag. Just add it and your problem will be solved.
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.dz122596.bubblebop"
android:versionCode="1"
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".startingpoint"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application> <!-- Add this closing tag -->
</manifest>
just make few changes to ur manifest file. follow below manifewst file.
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" />
<application android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<activity android:name="com.dz122596.bubblebop.startingpoint"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Use a broadcastreceiver implemented in another imported project

If i declare a broadcastreceiver in my Android app it's all alright. Now i am trying to use that receiver implemented in an imported project. In the main project i declare that receiver in the manifest with the correct path(from the imported project).
I don't understand if this can work, although i don't see why,but in debug mode the receiver is not reached.
This is in the manifest of the main project:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.main.project"
android:installLocation="internalOnly"
android:versionCode="1"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.Black.NoTitleBar" >
<activity
android:name="com.main.project.SplashActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.main.project.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<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="com.main.project.MainActivity"
android:scheme="oauth" />
</intent-filter>
</activity>
<receiver
android:name="importedproject.path.BBReceiver"
android:exported="true" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
</application>
</manifest>
And the manifest of the imported android library is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="importedproject.path"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="importedproject.path.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Am i missing something? thank you.

Error parsing XML: not well formed(invalid token)- can't spot error

Can someone spot the error in my AndroidManifest.xml? To me I have all the tags correct.
I have checked the other questions but have not spotted anything. The X in eclipse is on the application start tag.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="***"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="18" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.msc.mymedisense.Welcome"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.msc.mymedisense.MainActivity"
android:label="#string/title_activity_main"
android:parentActivityName="com.msc.mymedisense.Welcome" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.msc.mymedisense.Welcome" />
</activity>
<activity
android:name=".AppSettingsActivity"
android:label="#string/title_activity_AppSettings">
</activity>
<activity
android:name=".NotificationActivity"
android:label="#string/title_activity_notification">
</activity>
<receiver android:name=".TimeAlarm" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>

I've an exception when run android application?

I think the error is from this manifest file ?!! when i want to start this activity "SearchResultForm" i have the exception ??
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ayanoo.forms"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/search" android:label="#string/app_name">
<activity android:name=".MainActivity" android:label="#string/app_name" android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="PersonDataForm" android:label="#layout/person_data_form"></activity>
<activity android:name="SearchResultForm" android:theme="#style/CodeFont"></activity>
<activity android:name="SendMessageForm" android:theme="#style/CodeFont"></activity>
</application>
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>
</manifest>
You should have every activity of your appliaction listed within manifest file, like this:
<application android:icon="#drawable/ok" android:label="Application name">
<activity android:name=".main_screen.MyActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Your manifest has wrong links to your Activities (except the MainActivity).
You have:
<activity android:name="SearchResultForm" android:theme="#style/CodeFont"></activity>
Try to use:
<activity android:name=".SearchResultForm" android:theme="#style/CodeFont"></activity>
Pay attention to the dot.

Categories

Resources