Android :: Android Application Unit Testing

Aug 6, 2010

I'm new to android unit testing. I'm trying to write a unit test for the Phone application:

package com.android.phone;
import android.content.Intent;
import android.net.Uri;
import android.test.ApplicationTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import com.android.phone.PhoneApp;
import dalvik.annotation.TestTargetClass;...............

Android :: Android application unit testing


Android :: How To Reset/clear Application Preferences During Unit Testing

Oct 8, 2010

I want to start with a consistent test environment so I need to reset/clear my preferences. Here's the SetUp for test I have so far. It's not reporting any errors, and my tests pass, but the preferences are not being cleared.

I'm testing the "MainMenu" activity, but I temporarily switch to the OptionScreen activity (which extends Android's PreferenceActivity class.)

I do see the test correctly open the OptionScreen during the run.

CODE
:...............
StartNewActivity Code:

CODE:.................

View 1 Replies View Related

Android :: Unit Testing The Platform

Jul 14, 2010

I was finally able to build and debug the android platform (the process can be seen here). Now, the question is: where are the unit tests, how do I launch them and where do I see results? And also, is there any guide to android platform architecture?

View 1 Replies View Related

Android :: Unit Testing Localizations ?

Nov 17, 2010

There is no way to load a string from a specific locale's language file.

What I want to do is run all my locales' (I have 24 of them) time format strings through unit tests to make sure they don't crash. For example, here's a date format string in French: "'Hier à ' h:mm a".

These really need to be unit tested, because translators aren't great about properly escaping these strings, causing crashes unless we manually verify every string in every language every time we get a translation pass back.

This question has a sort-of answer. Is that really the only way? Is there a better way to specify the locale of a Context in unit tests?

View 1 Replies View Related

Android :: Unit Testing With Test Only Assets

Jul 3, 2009

I my main app and tests are organized like this (standard from "android create project"): AndroidManifest.xml assets/ main app asset files src/tests/AndroidManifest.xml -- uses <instrumentation> to point to the main app assets/ -- test-specific asset files src/ Writing test cases with AndroidTestCase, I'd like to load asset files from the test-specific assets/ directory, not from the main app assets/ directory. How can I accomplish that? The normal way to load an asset would be getContext().getAssets().open ("foo.txt"), for assets/foo.txt in the main app. I assume I just have to somehow change the Context or the AssetManager to point to the test- specific assets directory, but I don't see any way to do that. I have looked into the tests/bin/MyApp-debug.apk to confirm that the test assets are in there. Now I just need a way to access them.

View 2 Replies View Related

Android :: Unit Testing A Class That Uses .os.Handler

Oct 5, 2010

I have a class that uses a Handler for a timed, asynchronous activity.

Something like this:

CODE:.................

View 11 Replies View Related

Android :: Unit Testing & Using A Different Database File

Mar 30, 2010

I'm trying to start unit testing on my application (should have done so from the beginning). I've got an Eclipse project structure set up and everything seems to work well, but...

I'm subclassing SQLiteOpenHelper to access the application database. This works well for the application, but when using the same class in the unit tests, it writes to the same database as the actual application. This is obviously rather irritating, since unit test data shows up when developing and testing the actual application.

What's the best way to make the SQLiteOpenHelper class write to a different database file when being called from the unit tests?

View 2 Replies View Related

Android :: Unit Testing A Seek Bar's Events?

Dec 6, 2009

I have a very simple activity created with one seek bar. I'm trying to figure out how best to unit test the events.

Below is how I have the seek bar wired up in my activity.

CODE:.........

So with this I have a test class that extends ActivityInstrumentationTestCase and I have test method.

Should I not be able to so something like this? Right now I'm getting Test run failed: String resource ID #0x2 with this code.

CODE:....................

View 2 Replies View Related

Android :: Unit Testing Project Gets A NoClassDefFoundError For 3rd Party Jars

Oct 27, 2010

I'm trying to run unit tests on my Android app and I'm getting a NoClassDefFoundError when referencing 3rd party jars.

The classes in those jars are only referenced by the app itself, not the unit tests. The jars are on the apps classpath and have been exported in the eclipse settings to allow tyhem to be found by dependant apps - which, of course, the test app is.

View 1 Replies View Related

Android :: Unit Testing SQLiteDatabase Code - How To Instantiate A DB Instance Outside The Emulator

Feb 22, 2010

I need to run unit tests for code that references SQLiteDatabase for my Android code; however all my attempts to instantiate this object outside the emulator (on my desktop machine) have failed. JDBC on Android is not being recommended on the Net, hence it's out of the question (I could have provided mock objects very easily that way).

View 2 Replies View Related

Android :: Unit Testing Android Applications And Specifically Related To Db's

Dec 18, 2009

What is the easiest way to create some kind of test harness for Android apps and to be able to visualize (even on the emulator) what is going into the db? I want to test things like constraints, look at the data, unit test methods, etc. Is there any kind of GUI tool that I can hook up to the emulator to be able to look at the db of a particular app while I'm developing/testing, or are my only options the adb shell and creating test Activities within my app?

View 1 Replies View Related

Android :: Test Data Sources In Android Unit Testing

Jan 27, 2010

I want to test parsing of data returned from server.I thought I might create several test XML files and then feed them to the sax parser which uses my custom data handler (as in the application that I test).But where should I put those test XMLs?I tried with [project_root] /res/xml, but then I get the error: android.content.res.Resources $NotFoundException: Resource ID #0x7f040000 type #0x1c is not valid at android.content. res. Resources. loadXml ResourceParser(Resources.java:1870)at android.content.res. Resources. getXml(Resources. java:779) Does that mean that the xml is invalid, or that android couldn't find the XML file?(I use the same XML that comes from the server - copied it from the firebug's net panel and pasted into the file).Can I somehow read that XML as a text file, since etContext(). getResources() .getXml (R.xml.test_response1) returns XmlResourceParser instead of String (which I'd prefer)?

View 1 Replies View Related

Android :: Testing 3D GPS Application

Sep 9, 2009

We are working on an application that is a "Black Box in a phone" Written only for Android at the moment, we have tested on T1 and Magic, and we are looking for people to help us test it in various circumstances.

The app is designed for pilots and those that fly, tracks the phone in realtime and displays it on others phones and also in 3D on the website, GPS Logbooks - Home | Black Box Flight Recording, using only your Android cell phone.

The app is now in the marketplace, so we are looking for pilots, navigators, glider pilots, balloonists, sky divers and anyone else who likes to fly to download the app and go flying. After that you can publish your flights and share them with others.

Please note that your location data is visible to anyone on the site when you are flying live, so don't use it if you are somewhere that you don't want people to know about.

View 1 Replies View Related

Android :: Best Practice - Testing Application Kill

Mar 9, 2010

I'm having troubles with users that report that if they leave the application opened and after a few hours when they return to it the app crashes. I'm pretty sure it is because I'm not storing/restoring the status correctly when my process is killed by the system, but I would like to be able to test it in a repeatable way. Which is the best way to simulate the same behavior that happens when Android kills my process on low memory conditions?

View 4 Replies View Related

Android :: Testing Problem With ActivityInstrumentationTestCase2 - T - Error When Trying To Access Activity Under Testing

Feb 24, 2010

I wrote a simplest test based on android.test.ActivityInstrumentationTestCase2.

CODE:..............

View 2 Replies View Related

Android :: Points To Remember While Testing Droid Application?

Oct 2, 2010

What are different points to note down while testing android applications? What are different techniques or test cases used for android?

View 1 Replies View Related

Android :: Runtime (321) Java.lang.Verify On Testing Application

Oct 20, 2009

i get following error, if i test my app on a real android phone. On the emulator, my app works fine.

W/dalvikvm( 321): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) E/AndroidRuntime( 321): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 321): java.lang.VerifyError: de.stefandahmen.android.TourList E/AndroidRuntime( 321): at java.lang.Class.newInstanceImpl (Native Method) E/AndroidRuntime( 321): at java.lang.Class.newInstance (Class.java:1472) E/AndroidRuntime( 321): at android.app.Instrumentation.newActivity(Instrumentation.java:1097) E/AndroidRuntime( 321):.....

View 3 Replies View Related

Android :: How To Transfer Test Fixture File To Device From Unit Test Application?

Sep 24, 2010

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 Related

Android :: Android Functional Testing - Testing Multiple Activities

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

Android :: Mock And Performance Tests Available In Android For Testing Android Application

Dec 23, 2009

What exactly are mock tests... I need to know the mock and performance tests available in android for testing android apps..what is the best tool for testing android apps and how..

View 1 Replies View Related

Android :: Testing Android Application For Different Devices

Sep 18, 2010

my app works fine on samsung galaxy and nexus one. It is giving problem on htc incredible. How should I test my application for various phones?

View 4 Replies View Related

Android :: Testing Application For Android

Jun 14, 2010

I was wondering if any one had compiled a list of the most commonly used Android devices so I can get an idea of what I should test for. Even better would be suggested configurations for emulating each device.

View 2 Replies View Related

Android :: Testing Android Application

Sep 18, 2010

How do I test my android application such that it works on all major android phones ? e.g. Motorola, HTC, Samsung etc. I have an app that works on nexus one and samsung but it is giving problems on htc incredible.

View 4 Replies View Related

Android :: Default Display Unit Px Or Dp?

Oct 12, 2009

I always thought the default display unit would be pixels.But when I run my application on WVGA800 in the emulator the lines are five pixels wide even though I called Paint.setStrokeWidth(3). The same seems to happen with Drawable.setBounds(); the value I provide gets multiplied by 1.5 internally. If that's the case, how can I specify pixels instead of dips if I want pixels?

View 3 Replies View Related

Android :: Unit Tests Run Twice From Eclipse?

Jun 9, 2009

I've got unit tests which are subclasses of AndroidTestCase, I thought they were just taking awhile to run, but for some reason when I run them via Eclipse, they actually run twice. I can verify this in LogCat after the Console outputs "Launching instrumentation android.test.InstrumentationTestRunner on device..." the first run starts, which is only visible via LogCat. Then the JUnit pane comes to life and starts tracking the second run.

View 2 Replies View Related

Android :: Different Permissions / How Does Everyone Like Unit Converter?

Dec 23, 2009

I downloaded Unit Converter, and noticed that the market said it needed no permissions, while the manage apps list on the phone said it needed to modify the sd card and read phone state. Not that this was a huge deal, but why would they be different?
Anyways, how does everyone like that unit converter? It seems like it has everything!!

View 3 Replies View Related

Android :: Possible To Change Scale Of Sp Unit?

Oct 6, 2010

In my XML I can set textSize="18sp". Is it possible to change the scale of the sp unit which would affect all sp sizes but not affect dp sizes?

View 1 Replies View Related

Android :: Accessing A NAS Storage Unit In Workgroup

Aug 6, 2010

I have a NAS storage unit setup in a wireless workgroup I just wondered if anyone new of any way to access the NAS units files from my phone.I have a HTC Desire running Froyo.

View 4 Replies View Related

Android :: Verify Error While Trying To Run Unit Tests

Aug 5, 2009

I'm getting VerifyErrors when running unit tests. My tests are setup as a separate eclipse project which references the project I am testing. I have a class in my project which I use fairly heavily in my test project and this class is getting rejected by Dalvik.I also have a third party jar on the build path of both the project under test and the test project. This causes no problems when running the project under test so I can't see why it should when running the test project, basically I'm stumped. I have posted the error text below, MyProjectClass is a class in the project under test which is used fairly heavily in the test project.

View 7 Replies View Related

Android :: Setting Unit For Paint.set TextSize

Jun 17, 2010

Is it possible to change the unit for Paint.setTextSize?As far as I know,it's pixel but I like to set the text size in DIP for multiple screen support.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved