This is my AndroidManifiest.xml File
Their is 2 error
no resource identifier found for attribute 'launchmode' in package android
no resource identifier found for attribute 'stateNotNeeded' in package android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="a52.puri.fbkunal.com.launcher">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:stateNotNeeded="true"
android:
>
<activity android:name=".MainActivity">
<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.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
</application>
</manifest>
You are assigning unknown property for application tag, launchMode in android is for Activities. Activities launch and visible to user but Application launch only once when you start your App. You can say Application is a start point in Android App.
Assign a launchMode into Activity not in application tag.
Basically we could assign a launchMode directly as an attribute of <activity> tag inside AndroidManifest.xml file list this:
<activity
android:name=".SingleTaskActivity"
android:label="singleTask launchMode"
android:launchMode="singleTask">
Related
Iam trying to add Splash screen to my existing Android Project, which is not MainActivity.Java, but by default Android Studio is executing MainActivity.Java first, So I want to change the Activity Priority so that my SplashActivity.Java will execute first and later Activity's will follow after the Splash Screen.
Make splash activity your launcher activity instead of Main Activity in Android Manifest.
<activity
android:name=".ui.splash.SplashActivity"
android:screenOrientation="portrait"
android:theme="#style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
modify your AndroidManifest.xml like this
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.circlefil.reactivetrip">
<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"/>
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
You need to add IntentFilter in you splash screen activity and from splash screen activity you have to link your main activity using Intent.
Add following code to your splash screen activity.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
How ever keeping an entire activity is not the best way to create splash screen. See this for more info: Here
To Start activity first you need to make it Launcher Activity in AndroidManifest.xml file.
<activity
android:name=".StartingActivityName">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I am working the process of linking facebook login to my android application. In some tutorial I was asked to register my app with Facebook Developers website where I did everything but I couldnt find "Default Activity Class Name" in my Android Studio I have provided this below manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.evago.evago">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<!-- Front Page -->
<activity
android:name=".Frontpage"
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>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>
<!-- Search results activity -->
<activity
android:name=".SearchResultsActivity"
android:label="#string/title_activity_searchable"
android:launchMode="singleTop"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
</activity>
<!-- Search results activity Ends -->
</application>
Please help me in locating the "Default Activity Class Name"
should be the class containing:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
So its .Frontpage
Frontpage - This is the default activity name because its the launcher activity
When they tell me to add default activity class name, should I write com.example.milanovic.hellou.MainActivity or MainActivity or .MainActivity.
com.example.milanovic.hellou is the name of the package I'm using.
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
From my understanding, since you specify your package in the AndroidManifest.xml file, the MainActivity's package should be specified relatively to that. For example, if you package is com.example.app and your activity is com.example.app.Activity, then you can type it as .Activity(without dot is also fine), but if it is different, then full package as totally.different.package.Activity, if it is subpackage, try: .subpackage.name.Activity
Finally in your case it is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.milanovic.hellou">
...
<application ...>
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
So I have very weird problem with android app that I developed that I really do not understand how to address.
Description of the problem: When I run the app in my emulator(and many other emulators) the app works perfectly, but when I list it on Google Play and some user download the app, it automatically crashes. so I just wonder if my androidmainfest is properly written.
*the program written in esclipse, java, android.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app"
android:versionCode="6"
android:versionName="1.5" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.example.MainActivity"
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>
<activity
android:name="com.example.SurfaceExampleView"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.example.start" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.RulesGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.rules" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.PolicyGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.policy" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.RevenueGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.revenue" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.ShopGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.shop" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
You have posted only your manifest and not the logs. My guesses based on that is the problem may be within your package declaration, rest everything seems fine.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app".....
The package should be unique and its like what we call package in java world. You have declared it as com.app whereas your app is using com.example.... package. Also com.app maybe used by other app.The package name defines your application's identity.
Once you publish your application, you cannot change the package name. As the package name defines your application's identity, so if you change it, then it is considered to be a different application and users of the previous version cannot update to the new version. So you may have to upload another app with different package name.
Try getting logs(use crashlytics) for your crash and we can look into it for the root cause.
Problem: I'm developing content display app. Now I want to enable GCM push notification app, for that I downloaded a sample project from
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
The sample project is working fine and notification are coming as expected.
Now I copy pasted the following files to my project
1. manifest file
2. xml file
3. values file
4. MainActivity file
I changed the Packagename that I need from the pervious code that I copied but still it is not working. Please guide me which line i should change the packagename of project , where I should use class packagename and in where i should use the project packagename.
It is giving me error because the package name and sub package name are same.
Code:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<!-- Register Activity -->
<activity
android:name="com.androidhive.pushnotifications.RegisterActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Main Activity -->
<activity
android:name="com.androidhive.pushnotifications.MainActivity"
android:configChanges="orientation|keyboardHidden"
android:label="#string/app_name" >
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.androidhive.pushnotifications" />
</intent-filter>
</receiver>
<service android:name="com.androidhive.pushnotifications.GCMIntentService" />
</application>
being a newbie in android development, I'm not able to figure out which is the main package name in this code.
Any suggestion would be great!. thanks in advance
We add it like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mymain.package"
android:versionCode="1"
android:versionName="1.0" >
Sarthak Mittal is right, but you also need to change your manifest for main activity:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mymain.package"
android:versionCode="1"
android:versionName="1.0" >
<activity
android:name="com.androidhive.pushnotifications.MainActivity"
android:configChanges="orientation|keyboardHidden"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>