From f834639d23de7dae04280204f9afb9f16ad250b8 Mon Sep 17 00:00:00 2001 From: pfedor Date: Sun, 4 Jul 2010 05:34:19 +0000 Subject: [PATCH] Upgraded to the new SDK. Specified in AndroidManifest.xml that all screen sizes and densities are supported. --- AndroidManifest.xml | 10 +- build.xml | 352 ++++------------------ default.properties | 12 +- res/values/strings.xml | 2 +- src/org/jfedor/frozenbubble/GameView.java | 100 +++--- 5 files changed, 141 insertions(+), 335 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 5ae8f91..7d87a8d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,14 @@ + android:versionCode="7" + android:versionName="1.6"> + diff --git a/build.xml b/build.xml index 05dd141..ed950cb 100644 --- a/build.xml +++ b/build.xml @@ -1,293 +1,67 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - Creating output directories if needed... - - - - - - - Generating R.java / Manifest.java from the resources... - - - - - - - - - - - - - - - - - Compiling aidl files into Java classes... - - - - - - - - - - - - - - - - - - - - - Converting compiled files and external libraries into ${outdir}/${dex-file}... - - - - - - - - - - - Packaging resources and assets... - - - - - - - - - - - - - - - - - - - Packaging resources... - - - - - - - - - - - - - - - - - - - - - - - - - - Packaging ${out-debug-package}, and signing it with a debug key... - - - - - - - - - - - - - - - - - - Packaging ${out-unsigned-package} for release... - - - - - - - - - - - - - - - It will need to be signed with jarsigner before being published. - - - - - Installing ${out-debug-package} onto default emulator... - - - - - - - - Installing ${out-debug-package} onto default emulator... - - - - - - - - - - Uninstalling ${application-package} from the default emulator... - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/default.properties b/default.properties index e3b90ac..dbf05f2 100644 --- a/default.properties +++ b/default.properties @@ -1,5 +1,11 @@ -# This file is automatically generated by activitycreator. +# This file is automatically generated by Android Tools. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# Instead customize values in a "build.properties" file. +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. -sdk-folder=/home/pfedor/android/android-sdk-linux_x86-1.1_r1 +# Project target. +target=android-5 diff --git a/res/values/strings.xml b/res/values/strings.xml index 057b457..4c77a58 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -9,7 +9,7 @@ Sound On Sound Off About Frozen Bubble - Don't Rush Me + Don\'t Rush Me Rush Me Level Editor Redirecting you to the Market to download the Frozen Bubble Level Editor... diff --git a/src/org/jfedor/frozenbubble/GameView.java b/src/org/jfedor/frozenbubble/GameView.java index 6b6defc..89a66d7 100644 --- a/src/org/jfedor/frozenbubble/GameView.java +++ b/src/org/jfedor/frozenbubble/GameView.java @@ -69,6 +69,7 @@ import java.io.InputStream; import java.io.IOException; +import java.lang.reflect.Field; import android.content.Context; import android.content.res.Resources; import android.content.SharedPreferences; @@ -197,77 +198,96 @@ public GameThread(SurfaceHolder surfaceHolder, byte[] customLevels, Resources res = mContext.getResources(); setState(STATE_PAUSE); + BitmapFactory.Options options = new BitmapFactory.Options(); + + // The Options.inScaled field is only available starting at API 4. + try { + Field f = options.getClass().getField("inScaled"); + f.set(options, Boolean.FALSE); + } catch (Exception ignore) { } + mBackgroundOrig = - BitmapFactory.decodeResource(res, R.drawable.background); + BitmapFactory.decodeResource(res, R.drawable.background, options); mBubblesOrig = new Bitmap[8]; - mBubblesOrig[0] = BitmapFactory.decodeResource(res, R.drawable.bubble_1); - mBubblesOrig[1] = BitmapFactory.decodeResource(res, R.drawable.bubble_2); - mBubblesOrig[2] = BitmapFactory.decodeResource(res, R.drawable.bubble_3); - mBubblesOrig[3] = BitmapFactory.decodeResource(res, R.drawable.bubble_4); - mBubblesOrig[4] = BitmapFactory.decodeResource(res, R.drawable.bubble_5); - mBubblesOrig[5] = BitmapFactory.decodeResource(res, R.drawable.bubble_6); - mBubblesOrig[6] = BitmapFactory.decodeResource(res, R.drawable.bubble_7); - mBubblesOrig[7] = BitmapFactory.decodeResource(res, R.drawable.bubble_8); + mBubblesOrig[0] = BitmapFactory.decodeResource(res, R.drawable.bubble_1, + options); + mBubblesOrig[1] = BitmapFactory.decodeResource(res, R.drawable.bubble_2, + options); + mBubblesOrig[2] = BitmapFactory.decodeResource(res, R.drawable.bubble_3, + options); + mBubblesOrig[3] = BitmapFactory.decodeResource(res, R.drawable.bubble_4, + options); + mBubblesOrig[4] = BitmapFactory.decodeResource(res, R.drawable.bubble_5, + options); + mBubblesOrig[5] = BitmapFactory.decodeResource(res, R.drawable.bubble_6, + options); + mBubblesOrig[6] = BitmapFactory.decodeResource(res, R.drawable.bubble_7, + options); + mBubblesOrig[7] = BitmapFactory.decodeResource(res, R.drawable.bubble_8, + options); mBubblesBlindOrig = new Bitmap[8]; mBubblesBlindOrig[0] = BitmapFactory.decodeResource( - res, R.drawable.bubble_colourblind_1); + res, R.drawable.bubble_colourblind_1, options); mBubblesBlindOrig[1] = BitmapFactory.decodeResource( - res, R.drawable.bubble_colourblind_2); + res, R.drawable.bubble_colourblind_2, options); mBubblesBlindOrig[2] = BitmapFactory.decodeResource( - res, R.drawable.bubble_colourblind_3); + res, R.drawable.bubble_colourblind_3, options); mBubblesBlindOrig[3] = BitmapFactory.decodeResource( - res, R.drawable.bubble_colourblind_4); + res, R.drawable.bubble_colourblind_4, options); mBubblesBlindOrig[4] = BitmapFactory.decodeResource( - res, R.drawable.bubble_colourblind_5); + res, R.drawable.bubble_colourblind_5, options); mBubblesBlindOrig[5] = BitmapFactory.decodeResource( - res, R.drawable.bubble_colourblind_6); + res, R.drawable.bubble_colourblind_6, options); mBubblesBlindOrig[6] = BitmapFactory.decodeResource( - res, R.drawable.bubble_colourblind_7); + res, R.drawable.bubble_colourblind_7, options); mBubblesBlindOrig[7] = BitmapFactory.decodeResource( - res, R.drawable.bubble_colourblind_8); + res, R.drawable.bubble_colourblind_8, options); mFrozenBubblesOrig = new Bitmap[8]; mFrozenBubblesOrig[0] = BitmapFactory.decodeResource( - res, R.drawable.frozen_1); + res, R.drawable.frozen_1, options); mFrozenBubblesOrig[1] = BitmapFactory.decodeResource( - res, R.drawable.frozen_2); + res, R.drawable.frozen_2, options); mFrozenBubblesOrig[2] = BitmapFactory.decodeResource( - res, R.drawable.frozen_3); + res, R.drawable.frozen_3, options); mFrozenBubblesOrig[3] = BitmapFactory.decodeResource( - res, R.drawable.frozen_4); + res, R.drawable.frozen_4, options); mFrozenBubblesOrig[4] = BitmapFactory.decodeResource( - res, R.drawable.frozen_5); + res, R.drawable.frozen_5, options); mFrozenBubblesOrig[5] = BitmapFactory.decodeResource( - res, R.drawable.frozen_6); + res, R.drawable.frozen_6, options); mFrozenBubblesOrig[6] = BitmapFactory.decodeResource( - res, R.drawable.frozen_7); + res, R.drawable.frozen_7, options); mFrozenBubblesOrig[7] = BitmapFactory.decodeResource( - res, R.drawable.frozen_8); + res, R.drawable.frozen_8, options); mTargetedBubblesOrig = new Bitmap[6]; mTargetedBubblesOrig[0] = BitmapFactory.decodeResource( - res, R.drawable.fixed_1); + res, R.drawable.fixed_1, options); mTargetedBubblesOrig[1] = BitmapFactory.decodeResource( - res, R.drawable.fixed_2); + res, R.drawable.fixed_2, options); mTargetedBubblesOrig[2] = BitmapFactory.decodeResource( - res, R.drawable.fixed_3); + res, R.drawable.fixed_3, options); mTargetedBubblesOrig[3] = BitmapFactory.decodeResource( - res, R.drawable.fixed_4); + res, R.drawable.fixed_4, options); mTargetedBubblesOrig[4] = BitmapFactory.decodeResource( - res, R.drawable.fixed_5); + res, R.drawable.fixed_5, options); mTargetedBubblesOrig[5] = BitmapFactory.decodeResource( - res, R.drawable.fixed_6); + res, R.drawable.fixed_6, options); mBubbleBlinkOrig = - BitmapFactory.decodeResource(res, R.drawable.bubble_blink); - mGameWonOrig = BitmapFactory.decodeResource(res, R.drawable.win_panel); - mGameLostOrig = BitmapFactory.decodeResource(res, R.drawable.lose_panel); - mHurryOrig = BitmapFactory.decodeResource(res, R.drawable.hurry); - mPenguinsOrig = BitmapFactory.decodeResource(res, R.drawable.penguins); + BitmapFactory.decodeResource(res, R.drawable.bubble_blink, options); + mGameWonOrig = BitmapFactory.decodeResource(res, R.drawable.win_panel, + options); + mGameLostOrig = BitmapFactory.decodeResource(res, R.drawable.lose_panel, + options); + mHurryOrig = BitmapFactory.decodeResource(res, R.drawable.hurry, options); + mPenguinsOrig = BitmapFactory.decodeResource(res, R.drawable.penguins, + options); mCompressorHeadOrig = - BitmapFactory.decodeResource(res, R.drawable.compressor); + BitmapFactory.decodeResource(res, R.drawable.compressor, options); mCompressorOrig = - BitmapFactory.decodeResource(res, R.drawable.compressor_body); - mLifeOrig = BitmapFactory.decodeResource(res, R.drawable.life); + BitmapFactory.decodeResource(res, R.drawable.compressor_body, options); + mLifeOrig = BitmapFactory.decodeResource(res, R.drawable.life, options); mFontImageOrig = - BitmapFactory.decodeResource(res, R.drawable.bubble_font); + BitmapFactory.decodeResource(res, R.drawable.bubble_font, options); mImageList = new Vector();