I want to run my android app only on tablet , but it's running in phone also.
My Manifest file
<?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="com.example.sample">
<supports-screens
android:largeScreens="true"
android:normalScreens="false"
android:requiresSmallestWidthDp="600"
android:smallScreens="false"
android:xlargeScreens="true" />
<uses-feature
android:name="android.hardware.screen.landscape"
android:required="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<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/AppTheme1"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".MainActivity"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Can we run the app in generic phones when we apply android:normalScreens="false" & android:smallScreens="false" in supports-screens tag in android manifest file
You can do this:
In your first activity use this and get the size of the screen
If the size is not a tablet size, make a alert that say this app is only to tablet, then show a white screen/ another thing
Related
So , I was developing an Android application for Arduino and I was right about to post it on Google Play but first I though I should test it on different devices. So I sent my apk to a few of my friends.
Here are the devices i tested it :
One plus 6T : works perfectly
Asus zenfone 5z : again works perfectly
Samsung galaxy note 9 : when the app is opened it instantly crashes
Has anybody ever encountered such thing ?
My first guess was about the resolution of the device: the first two devices are running at a resolution of about 2280x1080 while the Note 9 runs at 2960x1440.
I added into the Android Manifest file the lines for supporting screens but seems that they don't help.
I also created "Landscape variations" and "tablet variation" for my first three activities but that also didn't helped.
Here is my Manifest code :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.edi.bluetoothgoogleplay">
<uses-feature android:name="android.hardware.bluetooth" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:xlargeScreens="true"
android:smallScreens="true">
</supports-screens>
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#drawable/newicon"
android:label="Arduino Controller"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".FirstActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".ChooseActivity"
android:screenOrientation="portrait" />
<activity
android:name=".CarActivity"
android:label="#string/title_activity_car"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.NoActionBar" />
<activity
android:name=".LedActivity"
android:screenOrientation="portrait" />
<activity
android:name=".TerminalBluetooth"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />
</application>
</manifest>
I deleted some textures and images, which i dont use from assets. And apk file which I build started to dont work. I can install to phone ( note 2 ) but it is not running. I can not see it in applications. only I can uninstall it.
I changed player settings and did not worked, I built for web and it works fine, I looked to android manifest xml and it is same with working apk which is old version.
Thank you for help.
my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:theme="#android:style/Theme.NoTitleBar" android:versionCode="1" android:versionName="1.0" package="com.unity3d.player" android:installLocation="auto">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="false">
<activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="#string/app_name" android:launchMode="singleTask" android:screenOrientation="reverseLandscape" android:name="com.unity3d.player.UnityPlayerActivity">
</activity>
<activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="#string/app_name" android:launchMode="singleTask" android:screenOrientation="reverseLandscape" android:name="com.unity3d.player.UnityPlayerNativeActivity">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
</application>
<uses-sdk android:minSdkVersion="6" android:targetSdkVersion="19" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.sensor.accelerometer" />
<uses-feature android:name="android.hardware.touchscreen" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
I am currently working on an app for my University, and everything is working great. Except Tablet compatibility. Below is my AndroidManifest file, does anypne have suggestions on what is wrong. The play store says "This app is not compatible with this device"
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rmu.mobile.tcdev"
android:versionCode="3"
android:versionName="0.0.3" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<uses-permission
android:name="android.permission.CALL_PHONE"
android:required="False"
/>
<uses-permission
android:name="android.permission.INTERNET"
/>
<supports-screens
android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:anyDensity="true"
android:largeScreens="true"
android:xlargeScreens="true"
/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/RealTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:allowBackup="true"
>
<activity
android:name="com.rmu.mobile.tcdev.RMULayoutsActivity"
android:label="#string/app_name"
android:configChanges="keyboardHidden|orientation|screenSize"
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=".ActionItemsSampleActivity" /> -->
</application>
</manifest>
android:required is not a valid attribute for uses-permission. Instead, you must add
<uses-feature android:name="android.hardware.telephony"
android:required="false" />
This depends on what the device you are running on it has installed. You have a min SDK version of 8. There are many devices that are running below that. Also, taking a look at my own code, the "supports screen" category is not 100% necessary.
I cant find out why my app is not supported on many devices like Xperia Z or Samsung Galaxy S4 and many more. Especially the newest devices and tablets are not supported.
Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.baoss_CDB"
android:versionCode="3"
android:versionName="1.2.1" >
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true"
android:resizeable="true"/>
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<application
android:name="com.baoss.Misc.MyApplicationContext"
android:icon="#drawable/cdb"
android:label="#string/app_name"
android:logo="#drawable/cdb"
android:theme="#android:style/Theme.NoTitleBar" >
<activity
android:name="com.baoss.LoginActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.baoss.MenuActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
...
<activity
android:name="com.baoss.SettingTermsOfUseActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
</application>
I hope you can help me=).
One thing I can notice is about
<uses-permission android:name="android.permission.CALL_PHONE" />
Infact that permission implies android.hardware.telephony features, which is generally available just on phones and not in tablets. Try marking that feature as not required:
<uses-feature android:name="android.hardware.telephony" android:required="false" />
Don't forget to check at runtime if the current device has phone capability:
PackageManager pm = getPackageManager();
if (pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)){
//Add the code for making call
}else{
//Add the code for devices where telephony is not present, if needed
}
I created an Android app with Phonegap. When the app runs and I flip the phone into landscape it simply crashes. I already tried adding this to my manifest:
android:configChanges="orientation|keyboardHidden"
also tried:
android:configChanges="orientation|screenSize|keyboardHidden"
No effect. Any suggestions?
Update:
This is what logcat tells me when the app crashes: http://dl.dropbox.com/u/17844821/zeug/logcat.txt
Update:
This is my manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.foo.bar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="15" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:configChanges="orientation|keyboardHidden"
android:name=".MainActivity"
android:label="#string/title_activity_main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Make sure that put those in the activity tag like this:
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize
|locale">
and close it after them.
I have this problem once and I made this mistake.
Do you have the INTERNET permission in your AndroidManifest.xml? Based on the exception it looks like the CallbackServer can't open a socket which would cause a bunch of problems.