Posts Tagged ‘Software development kit’

WARNING this is not for the faint-of-heart! It will break upon SDK revisions! Because it might result in more work for  GoogleOHA Engineers they might discourage it! WARNING, THIS ONLY WORKS WITH ECLIPSE! If you look at the SetUP Ant task code you will find that it checks for an sdk.ant.build.revision number with a max value of 3 set at this time. The value is stored in the sdk.properties file at the root of the platform version folder.

Now, here is the trick. Change the number to the max which is 3. DO NOT STOP YET AS YOU ARE NOT DONE. Copy the complete set of ant_rules_r2.xml, ant_libs_rules_r2.xml, etc and change the copy names to use r3.  Add the new obfuscate target making sure to add the other stuff such as Proguard config checking, etc. Now change that dex target by setting depends to include the obfuscate target you added after the compile target in that depends line.

Now, fire up Eclipse and compile all you want knowing that its being obfuscated automatically. Neat huh? FINAL WARNING, I HAVE NOT TESTED THIS WITH ANDROID LIBRARY PROJECTS YET!

I found it as I was looking at ways to decrease the ANT build script code I was writing and I really did not want to re-invent what Google/OHA were already doing with anttasks and android development tools. Its not the tools folks, despite what Joe Hewitt claims. Its the knowledge of hacking up the tools to do what you want!

Enhanced by Zemanta
Advertisements

As you might know android-src.jar for IDE code completion is not supplied by the SDK you download.  SOmeoen has stepped up agin and suppplied a zipped archive of classes for SDK 1.6.  As always download from the link on bug issue 979 and unzip in /sdk_install/platforms/1.6/sources and of course you will alos find the download link for Android 1.5 zippede file of classes on the same bug issue report.

Reblog this post [with Zemanta]

I am finishing up my next android contribution. Its a bug fix to fix the ANT support in the SDK by adding the proper ANT targets for unit and mock testing. If you have downloaded my Sdk customization extras you wil want to look at this bug fix as it has new targets added that are very useful. I will be posting a copy to this blog between now and Saturday.

List of new ANT  targets:

-tests.all

-tests.emma

-tests.functional

-tests.unit

-tests.log

-tests.all.breakpoint

-tests.small

-tests.medium

-tests.large

-tests.performance

The post at this blog will contain a link to a code sample showing code for all the tests as an example so everyone can use it as a guide . Still attempting to get sponsored support for covering these Android Agile method subjects so that I can publish some chapters, if you know of a firm that would sponsor this let me know.

Reblog this post [with Zemanta]
Image representing Android as depicted in Crun...
Image via CrunchBase

This set of steps is for those developing Android Applications. First setup your environment so that you can use repo per these instructions, do not download source yet. Okay now you ned to know which tag matches the SDK/Emulator version you have, in this case SDK 1.5.r2 has a source tag of Android-1.5r2 thus your download source command should be:

$ repo init -u git://android.git.kernel.org/platform/manifest.git -b Android-1.5r2

Now, to get the source sub-folders in a form that an IDE understands for Application Development you nee dot use Michael Forester’s ptyhon script, use my modified copy so that you do not get the out folder stubs(someone suggested the change on Michael’s post but it was not modified for that change, so I did it). You will run that python script at the root folder of the source that you downloaded. Than point your IDE to use that source modified set of sub-folders for your Andorid Application project, it wil be the sources sub-folder.

Now, when you debug your Android Application you will no longer get  the source not found error. As the release changes per the SDK/emulator that you use and download you will have to repeat the above process forr that new release. At times you may find the source tags influx with be able to mtach them aginst the SDK/emulator for exampel right after a new SDK/Emulator is released and in that case you may have to ue the master soruce tag to make sure that the repo pul lyou do matches the SDK/emulator you downloaded. If in doubt, pose the question on the Android Developers list.

Correction: for SDK1.5r2 you have to use the master tag to pull for SDK 1.5r2 as cupcake will not match and there is no Android-1.5r2 tag at that level.

Reblog this post [with Zemanta]

So how do we detect the Android SDK version so that the AndCoooper build tool can be used if the SDK is updated? Goolge/OHA through the SDK provide us with a ANT target property located in default.properties that is generated by the SDK. Normally, ANT does not support conidiotnal logic to hook into this but if you use a differnet optional task library such as ANTXtras you can integrate with this target property to determine not only the SDK version by adjust the classpaths for the tools and apis such as:

<!-- SDK Version setup -->
		<emit message="target: ${target}">
		<domatch property="target">
			<equals value="android-6">
<property name="android.sdk.version" value="android-3.0">
			</property>
			<equals value="android-5">
<property name="android.sdk.version" value="android-2.5">
			</property>
			<equals value="android-4">
<property name="android.sdk.version" value="android-2.0">
			</property>
			<equals value="android-3">
<property name="android.sdk.version" value="android-1.5">
			</property>
			<equals value="android-2">
<property name="android.sdk.version" value="android-1.1">
			</property>
			<!-- 1.0 is no longer supported in SDKs and thus not needed -->
		</equals>
		<emit message="android.sdk.version: ${android.sdk.version}">
		<!-- Set aidl framework location based on android.sdk.version value  -->
<property name="android.aild" value="${sdk.location}/platforms/${android.sdk.version}/framework.aidl">
<property name="android.jar" value="${sdk.location}/platforms/${android.sdk.version}/android.jar">
        <domatch property="mapapi">
		    <equals value="yes">
				<domatch property="oem">
					<equals value="no">
<path id="sdk.apis.classpath">
<pathelement path="${sdk.location}/platforms/${android.sdk.version}/android.jar">
<pathelement path="${sdk.location}/add-ons/google_apis-3/lib/maps.jar">
						</pathelement>
<property name="android.target.classpath" value="sdk.apis.classpath">
					</property>
					<equals value="yes">
<path id="sdk.apis.classpath">
<pathelement path="${sdk.location}/platforms/${android.sdk.version}/android.jar">
<pathelement path="${sdk.location}/add-ons/google_apis-3/lib/maps.jar">
<pathelement path="${sdk.location}/add-ons/${oem-vend-add-name}/${oem-vend-add-jarname}.jar">
						</pathelement>
<property name="android.target.classpath" value="sdk.apis.classpath">
					</property>
				</pathelement>
			</pathelement>
			<equals value="no">
				<domatch property="oem">
					<equals value="no">
<path id="sdk.apis.classpath">
<pathelement path="${sdk.location}/platforms/${android.sdk.version}/android.jar">
							</pathelement>
<property name="android.target.classpath" value="sdk.apis.classpath">

						</property>
					    <equals value="yes">
<path id="sdk.apis.classpath">
<pathelement path="${sdk.location}/platforms/${android.sdk.version/android.jar">
<pathelement path="${sdk.location}/add-ons/${oem-vend-add-name}/${oem-vend-add-jarname}.jar">
					    	</pathelement>
<property name="android.target.classpath" value="sdk.apis.classpath">

						</property>

					</pathelement>

				</path>

			</equals>
			<emit message="android.target.classpath set to:${android.target.classpath}">
<property name="sdk-location" value="${sdk.location}">

I also included some alpha code to integrate with OEM add-ons.

Reblog this post [with Zemanta]