Recent Notes

Displaying keyword search results 91 - 100
Created by freyo on September 09, 2011 11:43:36    Last update: September 09, 2011 11:45:45
When you run automated Android tests with Eclipse or from the command line, you get text output, which isn't good for reporting purposes. If you run a large set of test cases with automated build, the text report isn't very helpful. Fortunately, Android CTS generates test reports in XML with accompanying XSL to make it look nice in a browser. To run your own tests with Android CTS: Download Android CTS Make a new directory MyRepository under android-cts , alongside the existing repository directory. Copy host_config.xml from repository to MyRepository Create directory plans under MyRepository , add a test plan ( MyTests.xml ): <?xml version="1.0" encoding="UTF-8"?> <TestPla... Create directory testcases under MyRepository . Copy TestDeviceSetup.apk from repository/testcases to MyRepository/testcases Under MyRepository/testcases , create a test...
Created by freyo on September 09, 2011 09:18:32    Last update: September 09, 2011 09:19:23
To add your own test cases to the Android cts suite: Copy the whole example directory: cd cts/tests/tests cp -R example mytests Change mytests/Android.mk to fit your needs: LOCAL_PATH:= $(call my-dir) include $(CLEAR... Add the new tests to cts/CtsTestCaseList.mk : # These test cases will be analyzed by the CTS API... Develop the tests as usual If the test is not added to the CTS_COVERAGE_TEST_CASE_LIST , the build will only generate the xml file for the testcases, not the apk.
Created by freyo on September 07, 2011 16:46:14    Last update: September 07, 2011 19:23:00
The Android unit test framework is based on JUnit 3 , not JUnit 4. Test cases have to extend junit.framework.TestCase or a subclass (such as android.test.InstrumentationTestCase ). Tests are identified by public methods whose name starts with test , not methods annotated with @Test (as in JUnit 4). An Android test suite is packaged as an APK, just like the application being tested. To create a test package, first you need to identify the application package it is testing. Google suggests to put the test package source in a directory named tests/ alongside the src/ directory of the main application. At runtime, Android instrumentation loads both the test package and the application under test into the same process. Therefore, the tests can invoke methods on...
Created by freyo on August 31, 2011 15:49:54    Last update: August 31, 2011 15:49:54
Got this error while trying to build Android app: [apkbuilder] Creating AppInfo-debug-unaligned.ap... Solution: Delete the Android debug keystore: $ rm ~/.android/debug.keystore Build again: $ ant debug The new key is valid for 30 years (keystore password is 'android'): $ keytool -list -v -keystore ~/.android/debug.keys...
Created by freyo on August 17, 2011 12:29:46    Last update: August 17, 2011 12:29:46
In Android.mk , you can define LOCAL_JARJAR_RULES like this: LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.t... and in jarjar-rules.txt define a rule like this: rule org.bouncycastle.** com.android.@0 The build will change all org.bouncycastle to com.android.org.bouncycastle . Therefore, in your classes which are dependent on the library produced, the import statements should look like: import com.android.org.bouncycastle... Help for the jarjar utility (in prebuilt/common/jarjar/ ): $ java -jar jarjar-1.0rc8.jar Jar Jar Links - ...
Created by freyo on August 04, 2011 14:50:32    Last update: August 04, 2011 14:50:32
Take these steps to automate Android APK signing with release key: Put the release key in the Java keystore, for example: /home/freyo/.keystore Create build.properties file with key.store and key.alias entries: key.store=/home/freyo/.keystore key.alias=andro... Build APK with ant release : $ ant release Buildfile: /home/freyo/AndroidApp...
Created by freyo on August 04, 2011 12:27:27    Last update: August 04, 2011 12:30:42
I got this error while building an APK: [apply] [apply] UNEXPECTED TOP-LEVEL ERROR... Apparently the dx tool was running out of memory. The dx script (shell or bat) provides options to pass in Java options, but it's a lot easier just to bump up the default in dx : # By default, give dx a max heap size of 1 gig. Th... Here, I changed the default 1024M to 1624M and resolved the problem.
Created by Dr. Xi on July 27, 2011 08:55:34    Last update: July 27, 2011 08:55:34
It is OK to remove elements from a list with Iterator , but you get UnsupportedOperationException if the list is created with Arrays.asList : import java.util.*; public class IteratorRe... Prints: ArrayList test: ================ List size: ...
Created by freyo on July 21, 2011 12:58:59    Last update: July 21, 2011 13:02:17
From Android Developers : You can use a third party JAR in your application by adding it to your Eclipse project as follows: In the Package Explorer panel, right-click on your project and select Properties . Select Java Build Path , then the tab Libraries . Press the Add External JARs... button and select the JAR file. Alternatively, if you want to include third party JARs with your package, create a new directory for them within your project and select Add Library... instead. It is not necessary to put external JARs in the assets folder. Apparently, this is not working for me! I added a libs folder, put the external jar in libs . The project built fine, but the APK does not include the...
Created by meiu on July 21, 2011 09:34:10    Last update: July 21, 2011 11:00:42
Click Project -> Properties Select "Builders" Click "New", select "Ant Builder", click "OK" Select the Buildfile, set the Base Directory Set targets You may or may not want the default "Java Builder". Uncheck it if you don't want to run the default builder.
Previous  5 6 7 8 9 10 11 12 13 14 Next