Made one apk, installed two apps - android

I made an android app with External library. But I don't know why, when I install my apk(only one), installed two apps. One is mine and the other one is an example project of the external library. I think when I started my app, I had to understand how the library works, so I put that example project in my project.
But I can't find the example library's activity or layout somethings, and I don't know where to delete the settings of install example library. It seems like ghost...

you should check AndroidManifest.xml in your 3rd library and remove
<intent-filter>
<action android:name = "android.intent.action.MAIN" />
<category android:name = "android.intent.category.LAUNCHER" />
</intent-filter>

Related

RingCaptcha SDK import into android studio shows two app icons

I have added ringcaptcha sdk using android studio in my app. But after adding ring captcha sdk app shows two icons(My app and Ringcaptcha Sample).
How can I remove second app icon?
I have added following maven repository(url 'http://ringcaptcha.github.io/ringcaptcha-android').
Also added dependencies (compile 'com.thrivecom:ringcaptcha:1.0.7#aar')
Thanks in advance.
Launcher icons are added for an app by specifying <category android:name="android.intent.category.LAUNCHER" /> in the AndroidManifest.xml.
If you have LAUNCHER specified for two different activities then you will get two launcher icons.
Take a look in your AndroidManifest.xml for two activities that look like this:
<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>
EDIT: As you only have one LAUNCHER activity specified in your AndroidManifest.xml, the second one must be specified in the RingCaptcha aar.
This second LAUNCHER activity will be being added to the AndroidManifest.xml that is generated during the manifest merge built up from all the dependencies your project has (You can find this file under the build folder in your app if you want to check its contents).
You can view the RingCaptcha aar manifest by looking in the build folder of your project in Android Studio. You should find it here:
.../build/intermediates/exploded-aar/com.thrivecom/ringcaptcha/1.0.7
Opening the AndroidManifest.xml in this folder confirms it is adding the second LAUNCHER activity.
There are two ways to get around this.
Solution 1:
The easiest and best way is to use the latest version of the ringcaptch aar, 1.0.8.
compile 'com.thrivecom:ringcaptcha:1.0.8#aar'
Version 1.0.8 seems to have removed the offending activity so it should fix your problem.
Solution 2:
If for whatever reason you can't use the latest version of ringcaptcha then you will need to learn more about manifest merging and how to control and override items during the manifest merge. For example it may be possible to remove the Activity in the aar library by adding the following to your manifest file.
<activity android:name="com.thrivecom.ringcaptcha.sample.MainActivity" tools:node="remove"/>

Android - Is it possible to get two different apk just by cleaning the project?

I use the same source to make apk files.
But I found that I get the different apk files just because of cleaning the project.
Why I think I got two different apk files, I try to change locale, one apk got the language changed, and one is not.
I think there might be something wrong in my "AndroidManifest.xml" file.
Could this kind of thing happen?
i think you got two app launcher ... pls check your manifest file for this..
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
And this should be declared only once in manifest.. check any duplicate is there?

Apk installed on the device but I don't see it in the apps

I wanted to tweak a piece of sample code from API Demos group - GridLayout0. For it I created a separate project and copied GridLayout0.java into it. Now when I try to see the results of my changes, I get in the LogCat is
Uploading GridLayoutSampleTwicked.apk onto device '0388920542204257'
Installing GridLayoutSampleTwicked.apk...
Success!
/GridLayoutSampleTwicked/bin/GridLayoutSampleTwicked.apk installed on device
Done!
Apparently the apk is successfully installed on the device, but I don't see the app in the list of apps where I could launch it from (Wasn't it supposed to launch right after it was installed anyway?)
I am a noob, might have missed something.
If it matters, while creating the new project Eclipse asked me about the "root parent." I had to link it back to the API Demos package because Eclipse wouldn't let me proceed with the new project.
verify if this element exist in your main activity on manifest.xml :
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Yes, this part was missing. Adding this and deleting the snippet I gave below launched the app as I wanted it to.
Eclipse generated this code and I don't quite understand what it does
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.android.apis.view.GridLayout0" />

Flex Native Extension with Dropbox API for Android

I´m trying to develop a Native Extension for Flex in order to use the Dropbox API for Android. I have already tried this dropbox-r33 module for FLEX but it`s deprecated for Android 4, so this is not a solution for me.
I have already an ANE with Vibration and Dropbox connection. Vibration works perfectly (example from the web) and I tried to include the functions to use Dropbox API for Android (I have already tested it in an Android project and it works).
The problem is that I´ve been force to unpack the classes from the .jars needed in the Dropbox API in order that my ANE recognizes them but I´m getting this error:
05-29 12:02:21.489: I/ConnectionError(5798): android.content.ActivityNotFoundException: Unable to find explicit activity class {air.TestVibrationExtension.debug/com.dropbox.client2.android.AuthActivity}; have you declared this activity in your AndroidManifest.xml?
where TestVibrationExtension is my ANE´s project name. My package name is air.extensions and in that folder I have included the unpacked dropbox api classes (under air.extension.com and air.extensions.org).
Who has worked with Dropbox API knows that in the AndroidManifest you have to include the following activity declaration:
<activity
android:name="com.dropbox.client2.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:launchMode="singleTask" >
<intent-filter>
<!-- Change this to be db- followed by your app key -->
<data android:scheme="db-myAppKey" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
I think the error is related to that activity declaration but I don´t know what to do in order my ANE recognizes it.
Help please!
Dropbox-r33.swc module works but it is necessary to upload AIR library to it latest version. Doing it works on every Android platform perfectly.

Cant scan QR codes with ZXing

I'm really new in Android Development and, like many others, I'm trying desperately to integrate ZXing into my project. I have to make a stand-alone QR scanning application for Android. (I'm using the 2.3.3 sdk).
I have to explain that I've already tried to find a solution to my problem by reading all the answers about the topic but I haven't suceed at all.
Here is what I've done:
I downloaded the ZXing 2.0 Release from here
Then, I added the assets, src and res to my project simply by dragging the files into my
project.
I referenced the core.jar archive located in the "core" folder by right-clicking in my
project > Build Path > Configure Build Path. I add ir as an External JAR.
This is a image to ilustrate.
In here, I was getting some errors in the ID's and some other resources. That was
happening because I was referencing to que wrong R.java, so I solved that by changing "import com.google.zxing.client.android.R" to "import com.android.novaqr.R", which is my projects
package.
Then I added:
<uses-permission android:name="android.permission.CAMERA"/>
and
<activity android:name="com.google.zxing.client.android.CaptureActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="com.google.zxing.client.android.SCAN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
to the AndroidManifest.xml
So now I have no errors in my code and here is where i need help: I need the phone to scan when I push a button. I've tried a lot of solutions that I saw on the other questions about this topic, but I haven't succeed.
I hope I'm clear with my question, if not, let me know and I'll try to be more specific
Any help will be really apreciated.
You are strongly discouraged from completely copying and pasting our app. It sounds like you're not experienced enough in Android to use it this way anyway.
Instead, you can use the app's scanning service by Intent, which is far easier and supported: http://code.google.com/p/zxing/wiki/ScanningViaIntent

Categories

Resources