I have an application that I want to test on real device, and I have a Samsung Galaxy Mini which runs on android 2.3.6, but since the only available SDK for that is 2.3.3, I have selected that as a target build. When I plugin in USB ,windows does recognize it but eclipse does not, it won't install app on the device nor show it when the emulator is also running. Is it some kind of bug or what?
This is the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidhive"
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ng_icon"
android:label="#string/app_name" >
<activity
android:name=".Init"
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>
<activity
android:name=".Home"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.androidhive.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".CurentNews"
android:label="#string/title_activity_curent_news" >
<intent-filter>
<action android:name="com.example.androidhive.CURENTNEWS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".News"
android:label="#string/title_activity_news" >
<intent-filter>
<action android:name="com.example.androidhive.NEWS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
I think the problem is in device driver.
Can you please
Check output of "adb devices" command in console?
If nothing - check whick driver is installed for the device, and if necessary - manually install AndroidPhone -> ADB Debug Interface (In a list of system drivers)
Also check if "Allow USB debugging" is on in phone's Developer Settings.
PS: If no driver is found in the system - use SDK Manager to download GoogleUSB Driver, it will appear in "Extras" folder in Android SDK.
Good luck
Related
When running my app on my device straight from android studio, its running fine when deployed but its not actually installing - as in no icon in the menu etc (but it is in the settings under apps). Any help to solve would be great.
manifest is below.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.uk.malleymob.morecheatsforsims4" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/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=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MainActivity" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".generalCodes"
android:label="#string/title_activity_general_codes" >
</activity>
<activity
android:name=".interactions"
android:label="#string/title_activity_interactions" >
</activity>
<activity
android:name=".skills"
android:label="#string/title_activity_skills" >
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity" />
<activity
android:name=".simCheats"
android:label="#string/title_activity_cheats" >
</activity>
</application>
</manifest>
thanks in advance
Contrary to popular belief the action of this intent filter is not supposed to contain the activity's class name. This should fix it:
<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>
</activity>
It is definitely installed on the phone, if it was run on the phone.
You could try compiling the apk and manually installing with adb:
I assume you are using gradle to build:
From project directory root:
View build tasks:
./gradlew tasks
./gradlew assembleDebug
The apk would be created in app/build/outputs/apk/
Now cd to that directory and run:
adb install my-app.apk
Make sure your device or emulator is connected
I have developed a android wear demo application. The Android wear description mentions that the wear application is automatically installed on the wear device when installed on the mobile device.
My problem is now that this does not work. The app was created with Android studio.
Wenn I start the waer (sided) app with debugging enabled it installs the app on the wear device and it works ok. Once I install the mobile app (which includes the waer app) the wear on the wear device is deleted, bit the waer not installed on the wear device anymore.
Same happens when I want to debug the apps. Whenever I debug the mobile app the app on the wear device is deleted but not installed.
As written the curios thing is that I can install the wear app directly from within Android stuudio.
All the settings look ok, created automatically by Android studio.
The mobile manifest looks like that:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.waldhoer.klemens.klemenswearsampleapp" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".KlemensActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".FallRecognitionService" android:enabled="true"></service>
<service android:name=".DataLayerListenerService" android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
<uses-permission android:name="android.permission.BODY_SENSORS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
The wear manifest like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.waldhoer.klemens.klemenswearsampleapp" >
<uses-feature android:name="android.hardware.type.watch" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.DeviceDefault" >
<activity
android:name=".KlemensWearActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".WearFallRecognitionService" android:enabled="true"></service>
<service android:name=".DataLayerListenerService">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
<uses-permission android:name="android.permission.BODY_SENSORS" />
</manifest>
I also created a release version of the (mobile) app with Key signed, did not change anything.
Any idea what could be wrong? Thanks for help!
Why won't the app appear in the app drawer? It says in the App Manager that it is installed but I can't seem to open the actual app as it isn't in the app drawer. It doesn't automatically open it up once it's installed either.
Here is what is said when I choose to run on my phone (which is on Jellybean). It says the same thing when I install it to an emulator.
[2012-09-19 16:20:24 - TheForeverAloneQuiz] Performing sync
[2012-09-19 16:20:24 - TheForeverAloneQuiz] Automatic Target Mode: Several compatible targets. Please select a target device.
[2012-09-19 16:20:28 - TheForeverAloneQuiz] Uploading TheForeverAloneQuiz.apk onto device '001988a8094d8e'
[2012-09-19 16:20:28 - TheForeverAloneQuiz] Installing TheForeverAloneQuiz.apk...
[2012-09-19 16:20:31 - TheForeverAloneQuiz] Success!
[2012-09-19 16:20:31 - TheForeverAloneQuiz] /TheForeverAloneQuiz/bin/TheForeverAloneQuiz.apk installed on device
[2012-09-19 16:20:31 - TheForeverAloneQuiz] Done!
Here's the android manifest.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mikenning.foreveralonequiz"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Light.NoTitleBar" >
<activity
android:name=".Introduction"
android:label="#string/title_activity_introduction" >
<intent-filter>
<action android:name="android.intent.action.INTRO" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".QuestionOne"
android:label="#string/title_activity_introduction" >
<intent-filter>
<action android:name="android.intent.action.QUESTIONONE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Result"
android:label="#string/title_activity_introduction" >
<intent-filter>
<action android:name="android.intent.action.RESULTS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Anything I'm doing wrong?
SIDENOTE I also get errors saying that I do not need permission for the activities categorised as 'DEFAULT'. Could this be to do with it? I need it for the startActivity() in one of my clases so is it really not required?
I'm assuming that introduction is your first Activity. You need to add another action to it, like in the following code:
<activity
android:name=".Introduction"
android:label="#string/title_activity_introduction" >
<intent-filter>
<action android:name="android.intent.action.INTRO" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I know it is solved question, but this solution did not work for me and I wanted to share my solution here.
I was trying to add deep link support to my app, And in the documentation the
<intent-filter android:label="#string/filter_view_http_gizmos">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="gizmosexample"/>
</intent-filter>
I added those intent filters to my launcher activity and after app drawer stopped showing the app icon in the launcher.
So if #RaghavSood's solution above did not work, try to remove those filters or any other custom filters from the launcher activity's filters.
Good day,
I have an application which connects my android device to an arduino unit through a service. I have managed to make the connection but it keeps asking me for permission to use the accessory whenever I plug it in. Is there any way to bypass this permission? It works perfectly with an intent filter if I do it through an activity, I have tried applying the same intent in the service but it does not seem to work :/.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="blink.service"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-feature android:name="android.hardware.usb.accessory" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".ActivityCreate">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".StartupIntent" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name=".MainService"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="#xml/accessory_filter" />
</service>
<uses-library android:name="com.android.future.usb.accessory"/>
</application>
</manifest>
Here is the code in my manifest.
Thanx
To bypass permission you must make your app a system app. To make an app run as a system app you must place the apk in system/app folder. For doing that i first remounted the system drive as rw (read-write) using adb using the following code:
adb remount rw
push "apk path" /system/app
adb remount ro
Now reboot the system. Android will no longer ask for permission.
I have developed an Android application using Eclipse which works perfectly on the Android Virtual Device or when running it on my smartphone using Eclipse + USB Debugging mode enabled.
However, when I install the application on my phone using a signed apk file which resided on the sd card and try to launch it I get a "Activity not found - lsp.workshop" error, and the app won't start (lsp.workshop is the application package name).
the AndroidManifest.xml file is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lsp.workshop"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".TwitterLogin"
android:label="#string/app_name" android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme="twitter" />
<data android:host="log" />
</intent-filter>
</activity>
</application>
</manifest>
What am I doing wrong? Thanks
The emulator and android with a debugger attached can behave differently then when you start an app normally. The timing is different (influences multithreading and race conditions) and other things may be affected as well.
But just to be sure:
Did you list the activity within your AndroidManifest.xml file?
Is the spelling really correct?
If those things are not the problem, then could you show some code (how do you start the activity? with an intent?) and maybe the manifest file ?
Using two intent filters instead of one solved the problem:
<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.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="twitter" android:host="log" />
</intent-filter>
When you export your apk,be sure to name it -something.apk ,ie just put the ".apk" at the end when you export the application (y)