Android :: Launch App From Eclipse For Testing - LaunchMode Is Set To SingleTask
Jun 23, 2009
I've come across a very annoying problem, which only seems to happen when I launch my app from eclipse for testing. If I launch it normally, it doesn't seem to have this problem.
This is how I can reproduce it: - Launch app via Eclipse - Press Home - Relaunch app via icon - Click menu->exit which tells the Service to clean up and calls finish () when the Service finishes cleaning up
For some reason, there seem to be two instances of the activity, one exits normally and the other one gains focus. Clicking exit does nothing since the Service has stopped but the Service variable is not null. Attempting to use the app launches errors since the resource it uses have been closed. I can force a close via the crash and relaunch the app, and it exits normally this time.
As I said, it only happens when launching the app via Eclipse. Anyone know what could cause this? My launchMode is set to singleTask, however, that shouldn't cause an issue, I used that mode before. I tried calling finish() regardless of the state of the Service, but it doesn't seem to help.
View 5 Replies
Jul 25, 2010
Ive no doubt this question may have been addressed before but how can I turn on a framerate monitor to use when I run my programs using the android emulator so I can see exactly what my android game is achieving at a given time?
View 1 Replies
View Related
Jun 24, 2012
I have a simple app that i'm trying to test on my actual Android phones. I have an HTC merge and a Droid razr. Eclipse is installed on windows 7, not the 64-bit one. I downloaded the sdk and adt plugin and my app works must fine on an emulator. I installed the google USB drive via the adt manager, enabled USB debugging on both phones and also allowed non market apps to be installed. When I connect them to my laptop and try to run my app in eclipse, the only devices the IDE sees are the emulators..
View 2 Replies
View Related
Aug 18, 2009
I can find all the System.out.println in the log with a filter on "System.out". Neverless, when I switch off the emulator and that I test the application on the real G1 device (which is linked to computer with USB), there is no log anymore. Way to print some information on computer console or log while program is running on the device?
View 2 Replies
View Related
Jan 26, 2010
I'm trying to set up my workstation for Android development with Eclipse Galileo. I installed the latest ADT plugin and the Android SDK, but I get this error when I try to run any basic Android project I create code...
View 3 Replies
View Related
Aug 7, 2010
I've been programming Android in Eclipse for about a year now and I have always launched my app by right clicking on my project name in the project explorer, followed by "run as", then "Android Application". There has to be a better way...
Is there a way to change this (three mouse clicks): "Right click on project" -> "run as" -> "Android Application"
To this (one hotkey press): <My favorite hotkey>
So I can just press one button to launch my app?
View 2 Replies
View Related
Jul 24, 2009
Is it possible to configure android eclipse plugin that it does not start up whenever I launch eclipse? I don't have android perspective enable, and yet android plugin start itself up as part of eclipse launch (i can tell by ddms port is no available). I would like android plugin to start when I click android perspective.
View 2 Replies
View Related
Apr 2, 2010
Does anyone know how to DEBUG build an APK and launch it directly with Eclipse?
in my case, no matter whether i use Run> or Debug> menu command in Eclipse, my apk always logs Config.DEBUG as "false", although obviously the apk is signed with the key in factory debug.store.
View 1 Replies
View Related
Jun 5, 2010
Do we need to launch the virtual device from eclipse every time we want to test our code? If yes, then is there any other method to make it a bit faster?
View 4 Replies
View Related
Feb 24, 2010
I wrote a simplest test based on android.test.ActivityInstrumentationTestCase2.
CODE:..............
View 2 Replies
View Related
Sep 10, 2010
I've been learning Android and have come across an issue with launchMode="singleTask". The documentation states that when this attribute is used, the Activity is always launched into a new task as the root Activity. Secondly, the documentation states that if an Intent is targeted at such an Activity when there are Activities sitting above it in its task stack, such Intents are discarded (although the task is still brought to the foreground).I've been playing around with this, and the behaviour I observe is completely different. In particular:
- Activities with launchMode="singleTask" are not always the root Activity in a task stack. They are just plonked ontop of the existing stack with the same affinity.
- When an Intent is targeted at such an Activity and there are other Activities above it in the stack, the Intent is not discarded. Instead the Activities above it in the stack are discarded. The Intent is then delivered via onNewIntent to the Activity as normal.
Can someone confirm that this is the actual behaviour? If so, why are the documents incorrect? If not what have I done wrong.
View 1 Replies
View Related
Nov 12, 2010
I have an application that runs in the background, and displays an error message via the notifications system. This notification has a pendingIntent that leads back the the app's main screen. On this main screen, I have set launchmode="singleTask". As I understand it from the Android Dev Guide, this should mean that my main activity will only ever have one instance.However, if the user is viewing that activity at the time (or another one within the app), and goes and touches the notification to clear it, it goes ahead and puts another copy of the activity on the stack, so if I hit the back button, it will return to the main screen again (from the main screen).
View 2 Replies
View Related
Apr 16, 2009
I've been exploring the Android test package and I'm very confused on how to implement functional testing for endpoint-to-endpoint.
Consider the example below, I have 4 activities: 1. A Contact List Activity 2. A View Contact Activity 3. An Add/Edit Contact Activity 4. A Sync Contact List activity
I want to automate a few tests that will go through multiple test cases simulating a user experience: From launching the application, to selecting 'Add contact;' opening the add contact activity, entering data, saving it, going back to the list activity, and verifying the new contact was saved properly.
As I understand it, ActivityInstrumentationTestCase<T extends Activity> and ActivityUnitTestCase<T extends Activity>, are only useful for testing single activity functionality.
But what if I need to switch between 2 or more activities inside a single functional test case?
View 5 Replies
View Related
Mar 31, 2010
I have an app with two activities, one of which the launchmode is set to "singleTask". From the Android dev guide, I got the impression that my SingleTaskActivity should start a new task (or reuse an old task) and always sit at the root of the stack when launched.
However, it's inconsistent with the behavior of the app if I follow the steps below: - launch StandardActivity from home - click the "home" key - launch SingleTaskActivity from home, you will see it's in the foreground as expected - click the "Back" key, StandardActivity comes to the foreground whereas I expect to see the home screen because SingleTaskActivity is supposed to be at the ROOT of the stack. It appears SingleTaskActivity was launched into the task that StandardActivity started, rather than starting its own task.
Is my understanding about the "singleTask" launch mode correct?
=== The Android Dev guide (http://developer.android.com/guide/topics/ manifest/activity-element.html#lmode) says:
In contrast, "singleTask" and "singleInstance" activities can only begin a task. They are always at the root of the activity stack. Moreover, the device can hold only one instance of the activity at a time — only one such task.
CODE:.....................
View 5 Replies
View Related
Sep 16, 2009
In the documentation it is stated that an activity with launchMode="singleTask" is always at the root of the sctivity stack. However, when I run my "singleTask" activity for a few scenarios and monitors behaviour with "adb shell dumpsys activity" I can see it placed both at the top of the stack (with numActivities=2) and in the middle of the stack (with numActivities=3). The activity at the root (frontOfTask=True) has a "normal" launchMode.Is the documentation incorrect or am I missing something?
View 5 Replies
View Related
Feb 18, 2010
I have an activity, ActivityA, and its launchMode is set to "singleTask".I start the application from the app tray. ActivityA launches ActivityB from a button click. ActivityB is a normal activity with no launchMode set ("standard").With ActivityB on top of the activity stack, I hit the home button, then resume the app, I see ActivityA instead of ActivityB when resumed.Shouldn't the history stack be preserved in this case, and B be showing? When I resume, I see A get onNewIntent() called, and I'm not sure why this is happening. I thought the stack would be preserved.
View 1 Replies
View Related
Apr 22, 2010
So I have a MapActivity that runs an asynchtask that occasionally updates what exactly it's displaying on the map (via a string). I originally pass this string in from the intent when the activity is first created. And then if you click on one of the drawables on the map, it opens a new activity, which can then create a new mapview (same class) with a different string setting. The problem I have is that I only want one instance of the mapview to be running at once. Thus I set android:launchmode="singletask" in the manifest. This works in that it brings the mapactivity to the front, but is there any way to send it a new intent bundle to get a new setting for the string it needs? I tried regetting the extras from the bundle, but it seems to retain the old bundle, not the new intent that was passed to it. I'm not sure I want to do startActivityForResult because the 2nd activity may or may not want to update the original activity. I hope that made sense. I can post code if necessary, but I think that should explain my situation.
View 2 Replies
View Related
Oct 13, 2009
Our application which consists of something like this: Main menu => View contacts => Edit contact => View groups => Settings => Browser settings
I have then added gestures so that the user can jump between any of these screens with a gesture. But this leads to a huge activity stack that just grows and grows so how should I properly implement this?
I thought about the following: Main menu (SingleTask) => View contacts (SingleTop) => Edit contact => View groups (SingleTop) => Settings (SingleTop) => Browser settings (SingleTop)
If I do nothing then I end up with something like this (using gestures): Main menu - View Contacts - Main Menu - Browser Settings - View Contacts - Main menu
I would guess this would lead to memory issues sooner or later?
View 5 Replies
View Related
Jan 9, 2010
In a number of questions (like this one) I have been looking into how to "change screens" in my app. I have a "header" on top, with 4 buttons. Each button is meant to replace the "content" (ie change screen):
+--------------------+
| menu with buttons |
+--------------------+
| |
| |
| C O N T E N T |
| |
| |
+--------------------+
When I click a Menu button, I run the following code:
CODE:..............
As you can see, the startActivity is executed. Now, if I do not specify "launchMode" for the Activity that means that launchMode = normal. If launchMode == normal that means that the Activity will be re-created each and every time I navigate using the top header buttons, and that means that all data entered in "form elements" are gone (or at least hidden).
So, I found the launchMode "singleTask" that sounded sort of nice. If I add that launchMode to my Activity, it will not be re-created when I navigate with the buttons, thus keeping state. Great! Well, until I read this:
As noted above, there's never more than one instance of a "singleTask" or "singleInstance" activity, so that instance is expected to handle all new intents.
I found out that the sentence mean that there can be only one Activity that has the launchMode set to "singleTask" - if I have more than one it wont work (no compiler error though).
This means that I can only "keep the state" for one Activity, when switching back and forth (navigating) between my screens!
View 3 Replies
View Related
Feb 17, 2010
I'm not sure why onPause() is not called in the following scenario.
Here's my activity:
CODE:.......................
View 3 Replies
View Related
Feb 24, 2010
What is the best way to launch an app and calculate its launch time in android(if it can be done with some code,then its better)
View 2 Replies
View Related
Jun 22, 2010
I want to get started with an Android application but can't download the plug-in.
Anyone know where else I can get this?
View 3 Replies
View Related
Jan 30, 2009
I can't seem to get anything back from https://dl-ssl.google.com/android/eclipse/ - even accessing from a browser just gives a 404.
View 6 Replies
View Related
Oct 10, 2010
I don't know if this is kosher, but I wanted to see if anyone would want to test an app I built. I don't want to release an app to the market without getting out all the bugs I can, but I'm a lone developer trying to build apps on the side in my free time. I don't know many people with Droids, so I'm trying to reach out to the community. I built an app I call "Next Track on Shake". Not a good name, (and I'm up for suggestions for a better name) but I can't think of anything else to explain its function. I listen to alot of music, usually on shuffle, and I hate having to wake the phone up, unlock the screen, open the music player, and change the track. The new versions of Android require PIN or Password when you use a corporate account, and that adds another step in changing tracks. I built an app that allows you to shake the phone, whether awake or not, and it will move to the next track for you. I also added the ability to customize the shake; you can set how hard or how fast you need to shake the phone to change the track. The default shake is a good setting for most people, but alot of people jog with the phone on their arm or hip and would need to adjust the strength of the shake so as to not accidentally change tracks. I've also added the ability to stop/start the service when needed, and I display an ongoing notification when the service is running. When the phone is rebooted, the app checks the preferences, and only starts the app if you had the service running before reboot.
View 3 Replies
View Related
Jan 26, 2010
I have created an app which needs some testing done. I have tested it on the HTC Hero (UK version) and the HTC Tattoo. Worked well on both the devices. I wanted to test it on the newer android phones like the Droid or the Nexus One. If anyone could help me out with the testing, there is a link to the .apk file below. This app does functions like silencing the ringtone when the phone is flipped, switching on the speakerphone when in call etc.
http://dl.dropbox.com/u/556550/FlipShake.apk.
View 3 Replies
View Related
Jun 24, 2009
I'm prepping my first app for publishing and am a bit confused about how to properly test my <uses-permission> tags.. if i don't specify any permissions my app runs with no complaints on my G1. I tried installing it via "adb install" as well as with the eoeAppInstaller (as somebody had recommended). Also, the app is signed with my own certificate (not the debug cert). given that it works fine with no permissions (btw, it accesses camera and sd card), how will I know if I've set all of the proper <uses- permission> tags?
View 5 Replies
View Related
Feb 8, 2010
Is there anything to test the UI of an Android app like Jemmy for Swing?
View 3 Replies
View Related
Jul 18, 2010
Can someone with a Nexus One download AppFriend from android market (qr code -http://www.zappmarket.com/catalog/27) and give me a stack trace of the error message? I've got reports coming in that it crashes on startup (and the nice 1 star reviews that follow). The code that it is breaking on is really simple, so I'm not sure what the incompatibility could be, as it works on G1 and Magic.
View 4 Replies
View Related
Nov 13, 2009
We have many phones, but we don't--and probably never will--have all of them.
It's frustrating that some phones cannot see our apps in the market, and we'd like to know which phones those are.
We'd like to have a simple way to have our app tested on each phone, but at this point there's no easy way to do that.
My question is: what would we as developers be willing to do to get these needs met? Is there enough demand for someone to buy all possible Android devices and charge a nominal fee for these services?
We would pay a small fee to have out app accessed and downloaded on all phones--this would give us a report of which phones could access our app. We would pay a fee to have a step-by-step test ran on each possible device so we could know it worked on that device, at least minimally.
View 3 Replies
View Related
Jul 8, 2010
I have some questions about the testing of bluetooth.
I have tried the bluetooth chat and it worked pretty well on my two Andriod 2.1 based mobile phones.
However, this test can only be done only by someone who has 2 android phones and the version must be 2.1.
I assume this is a big issue because i looked into the CTS related to Bluetooth topic and it doesnt explain much about it.
The regular expectation for testing Bluetooth should be:
# Scan for other Bluetooth devices # Query the local Bluetooth adapter for paired Bluetooth devices # Establish RFCOMM channels # Connect to other devices through service discovery # Transfer data to and from other devices
In my case:
I would like to implement the application to send the file(image file, mp3, whatever...) from my Android 2.1 mobile to any device with Bluetooth module.
View 3 Replies
View Related