Android Eclipse- Do I need a new Manifest file for each activity? - eclipse

I have 1 manifest file set up right now that has this inside it
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.treacheryofimages.www"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.treacheryofimages.www.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>
<activity android:name=".OtherActivity"></activity>
<activity android:name=".OtherActivity2"></activity>
<activity android:name=".OtherActivity3"></activity>
<activity android:name=".OtherActivity4"></activity>
</application>
</manifest>
I want to create new buttons for my second activity page. So do I need to create a new manifest page for every activtity?

No, you don't create a second manifest. There is only one AndroidManifest.xml per project. I don't really see the relation that you are making between the buttons in an activity and the manifest file.

You should define your activities in the manifest file and leave your layouts in the
source/res/layout
folder, there you can use a layout file for each view for example
Here you can find the official Android documentation on how to structure your folders in your project.

Related

After publishing my unity game to Google Play and installing from the store, there is no Open/Play button

The game is listed on Google Play, but when I install it there is only an uninstall button. Also, the game icon is not added to the device. I've tried with multiple devices.
In settings -> apps, I can find the game, but no option to launch it.
This is my first game and I'm very excited, so will appreciate any help !!
The game:
https://play.google.com/store/apps/details?id=com.ijgames.morf
You need to add the UnityPlayerActivity to your manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="schemas.android.com/apk/res/android"
package="com.google.unity.ads" android:versionName="1.0"
android:versionCode="1">
<uses-sdk android:minSdkVersion="5" />
<application>
<uses-library android:required="false" android:name="org.apache.http.legacy" />
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-6148490449331637~7579554346" />
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="#string/app_name" android:taskAffinity="">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
</application>
</manifest>
Actually the main reason was that I haven't built apk for last version and was building aab, which was not showing errors. So I fixed the errors for apk build and all good.

flutter audio_service not working, errors in AndroidManifest.xml

I am attempting to recreate the audio_service tutorial on GitHub and it is not working, no sound is playing when you click the play button. I have observed an error in the AndroidManifest.xml which seems to be related - the documentation of course requires you add lines to the AndriodManifest.xml file.
However I am getting errors on the lines and which I suspect could be causing the problem. The errors are "Class referenced in the manifest, _______ , was not found in the project or the libraries / Unresolved package '___' " for both.
I did include these dependencies in my pubspec.yaml:
audio_service: ^0.15.1
just_audio: ^0.5.2
Note that I am having the same problem on both my Windows 10 development environment and on my MacBookPro running Catalina. Does anyone know how I can resolve this? What am I missing?
Here is my complete AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tv.realhelp.new_audio_service_test">
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="new_audio_service_test"
android:icon="#mipmap/ic_launcher"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<service android:name="com.ryanheise.audioservice.AudioService">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>
<receiver android:name="com.ryanheise.audioservice.MediaButtonReceiver" >
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
</application>
</manifest>

android:label property not affecting flutter application name

I'm working on a simple flutter application and would like to change the name displayed under the icon, in the launcher. As far as I know this should be done on Android by changing
android:label
property in AndroidManifest.xml
The only problem is that changing it doesn't have any effect. My apps name is still the project name (eg. test_app).
I've tried typing the name directly into the field and creating another xml file in /android/app/src/main/res/values and reading the name from there. Like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My awesome app</string>
</resources>
and in the Android manifest.xml
android:label="#string/app_name"
This didn't help.
Here is everything between the application tags in my AndroidManifest.xml at this point:
<application
android:name="io.flutter.app.FlutterApplication"
android:label="My awesome app"
android:icon="#mipmap/ic_launcher">
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Also the package_info library gives the original working name (eg. test_app) and not the name I specified in the android:label.
Should this work when debugging?
Am I missing something basic?
Thanks!
So apparently running the app in release mode did the trick. No idea why but there probably is a good reason for it.

unity setup firebase FCM plus Facebook for android

I have tried the messaging app from quickstart-unity-master and it was working fine on it's own but when I have added the Facebook plugin the following happened:
The firebase FCM is initializing successfully but I am no longer receiving the OnMessageReceived and OnTokenReceived.
It has probably something to do with the com.google.firebase.MessagingUnityPlayerActivity activity not receiving the events, but I am not sure what is wrong since the Android manifest is still the same after adding facebook.
I am using facebook 7.10.1
Here is my android manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="${applicationId}" android:versionCode="1" android:versionName="1.0">
<application android:label="#string/app_name" android:icon="#drawable/app_icon">
<!-- The MessagingUnityPlayerActivity is a class that extends
UnityPlayerActivity to work around a known issue when receiving
notification data payloads in the background. -->
<activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:label="#string/app_name" android:icon="#drawable/app_icon" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<service android:name="com.google.firebase.messaging.MessageForwardingService" android:exported="false" />
<activity android:name="com.facebook.unity.FBUnityLoginActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityAppLinkActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityGameRequestActivity" />
<activity android:name="com.facebook.unity.FBUnityCreateGameGroupActivity" />
<activity android:name="com.facebook.unity.FBUnityJoinGameGroupActivity" />
<activity android:name="com.facebook.unity.AppInviteDialogActivity" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb11111111111111" />
<provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider233093877143960" android:exported="true" />
</application>
</manifest>
appreciate your help
the issue was some missing dependencies, at first i only included what is needed by both SDK and tried them separately and they worked, but together didn't work for some reason;
the solution was to switch the build system from internal to gradle , then you don't have to worry about the max DEX methods and you can let the google play resolver download all the needed JAR and AAR;

Android: permissions missing name and tags

I am quite new to Android programming and am attempting to create an app, but I wanted to make sure that I have everything correct and error free before I do. I have the following errors in my manifest file: missing name attribute in element ....and tag permission missing required attribute name. I thought I did have a name in permission ("#string/app_name") but the error is still there! here is a copy of the code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="s.p.cunningham.checkyournumberslotteryapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
<permission android:name="#string/app_name"></permission>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="s.p.cunningham.checkyournumberslotteryapp.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>
Delete the whole tag. It is not a requirement in most of the cases, but god know's why comes as default when you create a new android application project.
If it isn't required, you can delete that tag... if you want to add any permission, then , delete that and use
<uses-permission
android:name="your permission....."
/>