Android : Way To Test APK Files
Jun 17, 2010Is 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 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?
Can an android project in Eclipse be configured so that the built-in builders read from an alternative source directory? ie. "test/src" instead of "src"? and possibly even "test/res" instead of "res"? (It appears that setting dirs in the property files will only affect ant and not the built-in builders)
View 1 Replies View RelatedI'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 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() ;
why 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) { ....................
Can anybody advice what is the recommended directory to store files generated by your application: audio files, video files or some images.
If the phone contains SD card, it is clear that files should be saved there, but if there is no any external storage. where would you recommend to save to?
I wrote an app that downloads web sites and all their assets (images/stylesheets) to "disk" and therefore stores lots of small files on the SD card.
Sometimes it fails to delete large amounts of files and afterward the file system is r/o. To analyze that behavior I tried to do the removal of the files by hand and then go from there. But that already failed.
localhost:~ mkamp$ adb -d shell mount [.. some mounts ..] /dev/block/mmcblk0p1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1000,fmask=0711,dmask=0700,codepage=cp437,iocharset=iso8859-1,utf8 0 0 --> R/W
Last login: Wed Mar 18 19:41:49 on ttys005 localhost:~ mkamp$ adb -d shell rm /sdcard/newsrob/a* [.. minutes of silent deletes ..] rm failed for /sdcard/newsrob/a2aade03616c28b30_113.png, Read-only file system localhost:~ mkamp$
localhost:~ mkamp$ adb -d shell mount [.. some mounts ..] /dev/block/mmcblk0p1 /sdcard vfat ro,dirsync,nosuid,nodev,noexec,uid=1000,gid=1000,fmask=0711,dmask=0700,codepage=cp437,iocharset=iso8859-1,utf8 0 0 --> R/O now
The log contained nothing but the usual gc output and random WiFi status changed mumbo jumbo.
Anybody else seeing this behavior?
There were 6.500 files in that directory. Might that be the problem? I don't access the files with queries, I always have the exact name.
I am working on an android app. Where i need to parse some plist files from assets folder. I do understand how to use assets in android but now problem is that file sizes are more than 1MB and so android gives error Data Exceeds UNCOMPRESS_DATA_MAX (2183588 vs 1048576). how to access such larger files from assets? Also I cant reduce a file into small buffers because i am just sending it to "DocumentBuilder.parse(in)" as a whole so can not use buffer. The error is on line: Document doc = db.parse(in).
View 1 Replies View RelatedI am trying to overlay route data in KML files on a MapView.
The following code works great:
CODE:................
The only problem I have with this is that I don't need to re download these KML files every time. I have about 10-15 KML files that will rarely change. Also since it has to connect, download, and parse these each time there is a delay in opening the maps.
It would make a lot more since for me to save these as a local resource and have the URI reference it there. Is there a way to construct a URI using the geo: scheme and have it point towards a local resource?
It looks like file:///sdcard support was included in 2.1. The only reference I could find to it was at the end of this bug report thread. I am currently at work and don't have time to play with this yet but I would like to figure it out later. I feel like there are a lot of people on stackoverflow and elsewhere who would really appreciate a reasonable way to do this.
To android working on eclipse with android 1.5 r2 version when i am running a basic program its showing a error .apk file not found.
View 2 Replies View RelatedI want to know how to get the ringtone,audio files in the device and I want set them as alarm. I am working in the code to set the alarm and I want to know how to retreive audio or ringtones from the device.
View 1 Replies View RelatedI 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?
From the Android documentation:
"You can store files directly on the mobile device or on a removable storage medium. By default, other applications cannot access these files. "
I could write to the sdcard (/sdcard/file.tmp) and other apps could access these files, right?
I would like some local storage that I can write files to (and read from later) that are not accessible to other applications, and I will always have access to. The problem with the sdcard is that if someone plugs in a USB cable and turns on MSC, my application (and all applications on the phone) will lose (both read and write) access to the /sdcard directory. So I need something more reliable.
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 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.