Android : How Can I Test Action_Power_Connected Event?
Apr 7, 2010I would like to do certain action on the Broadcast Receiver for ACTION_POWER_CONNECTED. Can someone let me know the way of testing this on emulator.
View 4 RepliesI would like to do certain action on the Broadcast Receiver for ACTION_POWER_CONNECTED. Can someone let me know the way of testing this on emulator.
View 4 RepliesI am developing an application which requires to add Calendar event. I have written the code for inserting event to the calendar. But whenever i run my application, everytime i get error that "Fail to find provider info for Calendar" and it also throws me NullPointerException error. So, what it means and i found that emulator doesn't provide Calendar application in-built.I think if the Android Emulator doesn't have Calender API, so, naturally, it will not have any database URI in the emulator whereas the Contact has URI --"content://contacts/people". I also found the URI for Calendar as "content://calendar/calendars" but it doesn't work and it means that it gives me error cause of missing Calendar application.Can anybody clarify me, with suggestions regarding Calendar Event?
View 4 Replies View RelatedI am doing monkey test for my application, and I meet Remote Exception many times. I don't know why remote-invocation errors occurs. Has anyone experienced such exception?
Monkey Log snippet:
:Sending Pointer ACTION_MOVE x=-1.0 y=-3.0
:Sending Pointer ACTION_DOWN x=322.0 y=77.0
:Sending Pointer ACTION_UP x=322.0 y=77.0
:Sending Pointer ACTION_DOWN x=299.0 y=488.0
Error: RemoteException while injecting event.
Events injected: 11088
:Dropped: keys=0 pointers=2 trackballs=0 flips=0
## Network stats: elapsed time=1511978ms
(1511978ms mobile, 0ms wifi, 0ms not connected)
System appears to have crashed at event 11088 of 56000 using seed 25194847
I'm writing an Android JUnit test and want to copy/reset a test fixture file (it's an SQLite database file.) If I were within the main application, I know I could just place the file in the assets directory and use getResources().getAssets().open(sourceFile).However, this API appears to be unavailable from the ActivityInstrumentationTestCase2 class.Is there an easy way to copy a file over from the testing PC, or should I just keep a fresh copy of a test fixture on the device and copy it over a temporary file?
View 2 Replies View RelatedI am using ActivityInstrumentationTestCase2 to do some test for an activity. I get a button in the setUp() method like this: protected void setUp() throws Exception {super.setUp(); act = getActivity(); btn = Button)act.find ViewById ( R.id.bike_button ); // this button has been defined in layout} Then I use this button to perform a click in a test method like this: public void testBikeButton(){ //click the bike button btn.performClick();}
View 7 Replies View RelatedI use onLongClick and onClick events of a button to get user inputs. Whenever; the user long click and triggers onLongClick event, the onClick event is also triggered. I couldn't find my problem. The code of two methods are shown in below: Code...
View 2 Replies View RelatedI have never used JUnit before, and now I'm trying to set it up on an Android project.My project under test is fairly complex, including some JNI, but my test project, at the moment, is completely trivial. I have found many examples (that look totally different) online of how to make a test project, but it seems that no matter which one I follow, I get the same results.Here's my JUnit project code:package com.mycompany.myproject.test;
import android.test.AndroidTestCase;public class SimpleTestCaseExample extends Android TestCase {public void test_testOne() {fail("Just Always Fail");When I run, I see the following in Logcat:
stdout INSTRUMENTATION_STATUS: numtests=2
stdout INSTRUMENTATION_STATUS: test=test_testOne
stdout INSTRUMENTATION_STATUS_CODE: 0
stdout INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
stdout INSTRUMENTATION_STATUS: current=2
stdout INSTRUMENTATION_STATUS: class=com.mycompany.myproject.test.SimpleTestCaseExample
stdout INSTRUMENTATION_STATUS: stream=
stdout INSTRUMENTATION_STATUS: numtests=2
stdout INSTRUMENTATION_STATUS: test=testAndroidTestCaseSetupProperly
stdout INSTRUMENTATION_STATUS_CODE: 1
stdout INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
stdout INSTRUMENTATION_STATUS: current=2
stdout INSTRUMENTATION_STATUS: class=com.mycompany.myproject.test.SimpleTestCaseExample
stdout INSTRUMENTATION_STATUS: stream=.
stdout INSTRUMENTATION_STATUS: numtests=2
stdout INSTRUMENTATION_STATUS: test=testAndroidTestCaseSetupProperly
stdout INSTRUMENTATION_STATUS_CODE: 0
stdout INSTRUMENTATION_RESULT: stream=
stdout Test results for InstrumentationTestRunner=..
stdout Time: 0.07
stdout OK (2 tests)
stdout INSTRUMENTATION_CODE: -1
But, I get the following in the Console:Launching instrumentation android.test. Instrumentation TestRunner on device emulator-5554 Collecting test information Test run failed: No test results I have tried a variety of different things, messing with the basic TestCase class, or the TestSuite class, or a variety of other options. I tried to just go for the most trivial example because I'm really still trying to learn how this works.Whatever I try, I see this error.
I'm working on a school project and I'm researching testing possibilities for Android applications. On this page: http: // developer . android . com/ resources / tutorials /testing /hello android. Google writes about a unit test. Is this really a unit test? A Unit test will not integrate all classes and will not test in his context. So my opinion is it is not a Unit Test but an Integration Test.
View 7 Replies View RelatedOne more video about the fancy touchscreen of the Droid X. This one has happier results! Check it out at the link below.Droid X Touchscreen Test See you later. you'll know why this post is short when you read the blog. running downstairs!
View 5 Replies View RelatedI have a project (that compiles and runs in the emulator.) I have a test project that tests part of this project. This test project also compiles with no problems, but when I try to run (test) it in the emulator, I get a NoClassDefFoundError exception on one of the classes my test class tests (I hope that made sense!) when it starts to run in the emulator. This is coming out of the adb log. I looked in the bin directory (of the test project) for the missing class, but could not find it... Should it be there? I found no reference (apk, etc) of the project I am trying to test either in the test projects bin directory. How does the test project get the classes it needs to test against (in the classpath, I assume.) How do the tested classes get moved to the emulator? I did try running the app before testing, so I know it is installed and runs correctly. BTW, I am using netbeans with the nbandroid plugin.
View 1 Replies View RelatedI am unable to integrate Junit with Android. I am using Junit 3, I have also tried Junit4.
package* com.android.test;
import* com.android.MyActivity;
import* android.app.Activity; *
import* android.test.ActivityInstrumentationTestCase2;
public* *class* TestMyView *extends *
ActivityInstrumentationTestCase2<MyActivity> {
Activity myActivity ;
*public* TestMyView(String pkg, Class<MyActivity> activityClass) {
*super*(pkg, activityClass);
myActivity = getActivity() ;
I hope there is a way to resolve this or bye bye hero.
View 10 Replies View Relatedwhy CheckBox is always null.
<CheckBox id="@+id/checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" />
code file-
package com.reblogr.reblogrclient;
public class Test extends Activity { /** Called when the activity is first created. */
public CheckBox checkbox;
@Override public void onCreate(Bundle savedInstanceState) { ....................
I need a GPS application on android so I can test my gps function. Can any one who knows and being so kind to tell me about?
View 5 Replies View RelatedNeed to test apk file on actual G1 device urgently.
Could any anyone with the device please help me on this?
For the OEM, on the product line,we need to test the earpieces whether it works well. so I want to write a application which will play sounds through the earpieces. i want to know how can i play a sound through the earpieces? or if there is a better way to test the earpieces?
View 3 Replies View RelatedI would like to test my code which check the availability of the Text To Speech lib on the device before using it. For this I need to remove the TTS service which is already installed on my device (HTC Legend). Do you know how to do this ? (I only found to stop the service not to remove it) ...
View 3 Replies View RelatedIs there anything to test the UI of an Android app like Jemmy for Swing?
View 3 Replies View RelatedI am trying to implement serialization for an email application on the android (stroring username, password, server etc.), but in order to test it I have to close the application in the emulator and then re-open it to ensure that it looks and finds the file with the serialized objects. The problem is that when I close the application on the emulator uninstalls the application. I close the application with the finish() function. Any inklings as to why this happens? And it wasn't doing it until further along in my development stage.
View 1 Replies View RelatedI plan to submit an app for the ADC II. I wanted to know if it is required that I test my app on the Andoird Dev Phone? If it runs on the emulator is it safe to assume that it runs on an actual phone? The phone is pretty costly and will be useless for me after the contest. Is there a place I can rent the Dev phone?
View 7 Replies View RelatedWhere do I copy the apk file on the Motorola Droid? Which directory? Are there any possible issues I need to be careful of, it's also my personal phone.
View 3 Replies View RelatedWith froyo users can move a app to the sd card... How can i test if my app is on internam memory or on sd?
View 6 Replies View RelatedI am porting GPS to Android now. I have been look for many web site relate to Android GPS porting include this group. However, I also feel confused about that. I have some questions. Can anyone give me some suggestions and I will appreciate about that. 1.There are 3 files : Android.mk, gps.cpp and gps_qemu.c in hardware/ libhardware_legacy/gps. What is the functionality about the 3 files in directory gps. Should I modify the 3 files to implement GPS. In this web site http://www.netmite.com/android/mydroid/cupcake/development/pdk/docs/g..., it shows that anyone that want to integate GPS with Android should create a shared library named libgps.so refer to gps.h. My question is how to create a shared library libgps.so.If the libgps.so is created, where can I find it. What is the relation between libgps.so and libhardware_legacy.so. 3.How to test GPS if gps is implemented successfully. I know there is a gpstest tool in Android but I don't know how to use it. Can someone tell me the detail about gpstest tool provided by Android.
View 5 Replies View RelatedAfter a frustrating day of having the Emulator render lines strangely, and then discovering that my G1 renders them exactly as I expect, I am left to wonder how to test OpenGL (using GLSurfaceView).
Is the emulator sufficient to test code for correctness? I ask because I experienced the following on the emulator, but not on the G1, all using Ortho projection.
1) Line width depending on length! I drew a series of lines, most fairly short but several with endpoints close to the edge of the fixed- point number range. The long lines were rendered as wide. The short lines were rendered as 1 pixel wide.
2) Lines exploding to fill the whole screen when not appropriate to the scale (double the scale, line goes from 1/10th screen width to filling screen (or more).
3) Lines not appearing at all if horizontal.
Is the emulator a correct openGL implementation? If I see problems on the emulator, am I likely to see them on some hardware platforms?
Can I use my G1 as a reference platform?
Or do I need a whole slew of phones to verify that an openGl app (scientific graphics, not animated) works across all platforms?
Is there a way to test an APK file on the computer before installing on my new EVO?
Or maybe check it for a virus or such?
Is there any sort of automated test similar to this (The W3C Markup Validation Service) that can perhaps mark how the usability a mobile application is or whether it is secure etc.
Or is the best way to just give my prototype to testers and receive feedback.
i am working on android CTS test, i am getting API check time out error whenever i start test plan CTS, i followed the below steps for CTS test and also i mentioned my doubts.
CTS test steps :
1. Please download and install the Android 1.6 SDK on your machine.
2. Your phone should be running a user build (Android 1.6 and later) from source.android.com
3. Please refer to this link on the Android developer site and set up your device accordingly.
4. Make sure that your device has been flashed with a user build (Android 1.6 and later) before you run CTS.
5. You need to download the TTS files via Settings > Speech synthesis > Install voice data before running CTS tests. (Note that this assumes you have Android Market installed on the device, if not you will need to install the files manually via adb)
6. It is advisable to log in to the device with a test Google account, not an account that you actually use.
7. Make sure the device has a SD card plugged in and the card is empty. Warning: CTS may modify/erase data on the SD card plugged in to the device.
8. Do a factory data reset on the device (Settings > SD Card & phone storage > Factory data reset). Warning: This will erase all user data from the phone.
9. Make sure no lock pattern is set on the device (Settings > Security & location > Require Pattern should be unchecked.Google Confidential
10. Make sure the "Screen Timeout" is set to "Never Timeout" (Settings > Sound & Display > Screen Timeout should be set to "Never Timeout".
11. Make sure the "Stay Awake" development option is checked (Settings > Applications > Development > Stay awake).
12. Make sure Settings > Application > Development > Allow mock locations is set to true.
13. Make sure the device is at the home screen at the start of CTS (Press the home button).
14. While a device is running tests, it must not be used for any other tasks.
15. Do not press any keys on the device while CTS is running. Pressing keys or touching the screen of a test device will interfere with the running tests and may lead to test failures.
Doubts :
1) is it necessary to follow all the steps ?
2) for step 5, i copied the voice data to the SD card and if i follow step 8 it will erase all contents of SD card so how can i follow both step 5 and step 8 at a time...?
error message while doing CTS test on Device :
pvteam@pvteam-desktop:~/Desktop/android-cts/tools$ ./startcts
Android CTS version 2.1_pre_r1
Device(HT9A4LV00787) connected
cts_host > start --plan CTS
cts_host > There are 3 existing session(s) for plan CTS.
[code]...
the Device restart took place three times then i stoped the CTS test.
Do u know How to handle KEY_DOWN and KEY_UP event for SoftKeyBoard . i got one example in developer blog but its not enough to understand.
View 2 Replies View RelatedI kept getting annoyed at having to load the Calendar to have to add an event, so I built a one-tap-add-event app which you can put on the home screen.
View 2 Replies View RelatedI have 2 questions about android TrackBall Event. I appreciate if you can help me with them:Can I detect the speed of TrackBall event? like in Fling, I can detect a 'big' fling vs a 'small' fling. Can I fling via the track ball?Why TrackBall Event always follow by Key left/right events? To me, they seem duplicate.
View 1 Replies View Related