Re: [android-developers] Upgrade my Game Application

2010-09-07 Thread Dhrumil Shah
Hello,

Hope you all got what I mean to develop.
Please give me suggestions for upgrading my game.

~Dhrumil

On Mon, Sep 6, 2010 at 6:45 PM, { Devdroid } webnet.andr...@gmail.comwrote:

 On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com wrote:
  Hi Sandeep,
 
  I try to change it, but it shows an error like this:
 
  error: Error: Float types not allowed (at 'versionCode' with value
 '1.1').

 You should not change things you do not understand in hope it will work
 even you do not know why. There's clear error message quoted above
 and there's manual you shall read to get what value is valid there:
 http://developer.android.com/guide/publishing/versioning.html

 --
  You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Upgrade my Game Application

2010-09-07 Thread Miguel Morales
I'm having trouble understanding your question, what isn't being
upgraded?  The code?  Have you tried logging some debug text?  Are you
using the emulator?  How are you installing your app.  Also, please
use pastebin to post code.

On Mon, Sep 6, 2010 at 11:55 PM, Dhrumil Shah dhrumilsh...@gmail.com wrote:
 Hello,

 Hope you all got what I mean to develop.
 Please give me suggestions for upgrading my game.

 ~Dhrumil

 On Mon, Sep 6, 2010 at 6:45 PM, { Devdroid } webnet.andr...@gmail.com
 wrote:

 On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com wrote:
  Hi Sandeep,
 
  I try to change it, but it shows an error like this:
 
  error: Error: Float types not allowed (at 'versionCode' with value
  '1.1').

 You should not change things you do not understand in hope it will work
 even you do not know why. There's clear error message quoted above
 and there's manual you shall read to get what value is valid there:
 http://developer.android.com/guide/publishing/versioning.html

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://developingthedream.blogspot.com/,
http://diastrofunk.com,
http://www.youtube.com/user/revoltingx

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Upgrade my Game Application

2010-09-07 Thread Dhrumil Shah
I send my code.
In that code, I want to put Bouncing Ball. But I am not getting how to put
it.
I am very much thankful for you if you are helping me.

~Dhrumil

On Tue, Sep 7, 2010 at 12:41 PM, Miguel Morales therevolti...@gmail.comwrote:

 I'm having trouble understanding your question, what isn't being
 upgraded?  The code?  Have you tried logging some debug text?  Are you
 using the emulator?  How are you installing your app.  Also, please
 use pastebin to post code.

 On Mon, Sep 6, 2010 at 11:55 PM, Dhrumil Shah dhrumilsh...@gmail.com
 wrote:
  Hello,
 
  Hope you all got what I mean to develop.
  Please give me suggestions for upgrading my game.
 
  ~Dhrumil
 
  On Mon, Sep 6, 2010 at 6:45 PM, { Devdroid } webnet.andr...@gmail.com
  wrote:
 
  On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com wrote:
   Hi Sandeep,
  
   I try to change it, but it shows an error like this:
  
   error: Error: Float types not allowed (at 'versionCode' with value
   '1.1').
 
  You should not change things you do not understand in hope it will work
  even you do not know why. There's clear error message quoted above
  and there's manual you shall read to get what value is valid there:
  http://developer.android.com/guide/publishing/versioning.html
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to
 android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



 --
 ~ Jeremiah:9:23-24
 Android 2D MMORPG: http://developingthedream.blogspot.com/,
 http://diastrofunk.com,
 http://www.youtube.com/user/revoltingx

 --
  You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Upgrade my Game Application

2010-09-07 Thread Miguel Morales
You did not answer any of my questons, did you try logging?  Are you
using the emulator?  How are you installing your app?
We're not going to waste our time running or reading badly formatted
code without a good description of the problem.

On Tue, Sep 7, 2010 at 1:30 AM, Dhrumil Shah dhrumilsh...@gmail.com wrote:
 I send my code.
 In that code, I want to put Bouncing Ball. But I am not getting how to put
 it.
 I am very much thankful for you if you are helping me.

 ~Dhrumil

 On Tue, Sep 7, 2010 at 12:41 PM, Miguel Morales therevolti...@gmail.com
 wrote:

 I'm having trouble understanding your question, what isn't being
 upgraded?  The code?  Have you tried logging some debug text?  Are you
 using the emulator?  How are you installing your app.  Also, please
 use pastebin to post code.

 On Mon, Sep 6, 2010 at 11:55 PM, Dhrumil Shah dhrumilsh...@gmail.com
 wrote:
  Hello,
 
  Hope you all got what I mean to develop.
  Please give me suggestions for upgrading my game.
 
  ~Dhrumil
 
  On Mon, Sep 6, 2010 at 6:45 PM, { Devdroid } webnet.andr...@gmail.com
  wrote:
 
  On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com wrote:
   Hi Sandeep,
  
   I try to change it, but it shows an error like this:
  
   error: Error: Float types not allowed (at 'versionCode' with value
   '1.1').
 
  You should not change things you do not understand in hope it will work
  even you do not know why. There's clear error message quoted above
  and there's manual you shall read to get what value is valid there:
  http://developer.android.com/guide/publishing/versioning.html
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to
  android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



 --
 ~ Jeremiah:9:23-24
 Android 2D MMORPG: http://developingthedream.blogspot.com/,
 http://diastrofunk.com,
 http://www.youtube.com/user/revoltingx

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://developingthedream.blogspot.com/,
http://diastrofunk.com,
http://www.youtube.com/user/revoltingx

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Upgrade my Game Application

2010-09-07 Thread Dhrumil Shah
Hello Miguel,

Sorry for my fault.
-I write my code in Eclipse platform and run in Android SDK version = 1.
-I tried to debug it but I am not getting my solution. I think the problem
is overlapping of CANVAS.
How to solve overlapping canvas problem.

~Dhrumil.

On Tue, Sep 7, 2010 at 2:07 PM, Miguel Morales therevolti...@gmail.comwrote:

 You did not answer any of my questons, did you try logging?  Are you
 using the emulator?  How are you installing your app?
 We're not going to waste our time running or reading badly formatted
 code without a good description of the problem.

 On Tue, Sep 7, 2010 at 1:30 AM, Dhrumil Shah dhrumilsh...@gmail.com
 wrote:
  I send my code.
  In that code, I want to put Bouncing Ball. But I am not getting how to
 put
  it.
  I am very much thankful for you if you are helping me.
 
  ~Dhrumil
 
  On Tue, Sep 7, 2010 at 12:41 PM, Miguel Morales therevolti...@gmail.com
 
  wrote:
 
  I'm having trouble understanding your question, what isn't being
  upgraded?  The code?  Have you tried logging some debug text?  Are you
  using the emulator?  How are you installing your app.  Also, please
  use pastebin to post code.
 
  On Mon, Sep 6, 2010 at 11:55 PM, Dhrumil Shah dhrumilsh...@gmail.com
  wrote:
   Hello,
  
   Hope you all got what I mean to develop.
   Please give me suggestions for upgrading my game.
  
   ~Dhrumil
  
   On Mon, Sep 6, 2010 at 6:45 PM, { Devdroid } 
 webnet.andr...@gmail.com
   wrote:
  
   On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com
 wrote:
Hi Sandeep,
   
I try to change it, but it shows an error like this:
   
error: Error: Float types not allowed (at 'versionCode' with value
'1.1').
  
   You should not change things you do not understand in hope it will
 work
   even you do not know why. There's clear error message quoted above
   and there's manual you shall read to get what value is valid there:
   http://developer.android.com/guide/publishing/versioning.html
  
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
   android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
   For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en
  
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
   For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en
 
 
 
  --
  ~ Jeremiah:9:23-24
  Android 2D MMORPG: http://developingthedream.blogspot.com/,
  http://diastrofunk.com,
  http://www.youtube.com/user/revoltingx
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to
 android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



 --
 ~ Jeremiah:9:23-24
 Android 2D MMORPG: http://developingthedream.blogspot.com/,
 http://diastrofunk.com,
 http://www.youtube.com/user/revoltingx

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Upgrade my Game Application

2010-09-06 Thread dhrumil
Hello 2all,

I have developed one simple game application.
In that, the box is moving in all four directions. Now I want to
upgrade my game. So for that I just add one ball image on this
application. This ball image is bouncing all over the android screen.
I tried a lot but not able to upgrade my game. The only box is visible
on the screen and the ball image is not visible.

I want to display both of them on the screen.
How to do this?
Any suggestions.
Please anyone knows give me a reply.

~Dhrumil

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread Miguel Morales
How are you upgrading your game?

On Mon, Sep 6, 2010 at 3:28 AM, dhrumil dhrumilsh...@gmail.com wrote:
 Hello 2all,

 I have developed one simple game application.
 In that, the box is moving in all four directions. Now I want to
 upgrade my game. So for that I just add one ball image on this
 application. This ball image is bouncing all over the android screen.
 I tried a lot but not able to upgrade my game. The only box is visible
 on the screen and the ball image is not visible.

 I want to display both of them on the screen.
 How to do this?
 Any suggestions.
 Please anyone knows give me a reply.

 ~Dhrumil

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://developingthedream.blogspot.com/,
http://diastrofunk.com,
http://www.youtube.com/user/revoltingx

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread Dhrumil Shah
I developed one game its code is here:

*Testing.java*
*

package* com.paad.testing;

*

import* android.app.Activity;
*

import* android.os.Bundle;
*

import* android.os.Handler;
*

import* android.os.Message;
*

import* android.view.*;
*

import* android.graphics.*;
*

import* android.content.*;

*

public* *class* Testing *extends* Activity {

RandomView randomView = *null*;

*public* *static* *final* *int* *DIRECTION_RIGHT* = 0, *DIRECTION_LEFT* = 1,
*DIRECTION_DOWN* = 2, *DIRECTION_UP* = 3;

*protected* *static* *final* *int* *GUIUPDATEIDENTIFIER* = 0x101;

*private* Panel main;

*private* Bitmap scratch;

*private* Canvas offscreen;

*public* *boolean* start = *true*;

*private* *volatile* *boolean* running = *false*;

*private* *int* direction = *DIRECTION_RIGHT*;

*private* *int* boxx = 10;

*private* *int* boxy = 10;

Thread myRefreshThread = *null*;

Handler GUIUpdateHandler = *new* Handler() {

// @Override

*public* *void* handleMessage(Message msg) {

*switch* (msg.what) {

*case* Testing.*GUIUPDATEIDENTIFIER*:

randomView.invalidate();

*break*;

}

*super*.handleMessage(msg);

}

};

@Override

*public* *void* onCreate(Bundle savedInstanceState)

{

*super*.onCreate(savedInstanceState);

*this*.randomView = *new* RandomView(*this*);

*this*.setContentView(*this*.randomView);

(*new* Thread(*new* Refresh())).start();

setOffscreenBitmap();

main = *new* Panel(*this*);

setContentView(main,*new* ViewGroup.LayoutParams(320,480));

(*new* Thread(*new* AnimationLoop())).start();

}

*private* *void* setOffscreenBitmap()

{

scratch = Bitmap.*createBitmap*(30,30,Bitmap.Config.*ARGB_*);

offscreen = *new* Canvas();

offscreen.setBitmap(scratch);

offscreen.drawColor(Color.*RED*);

}

*private* *synchronized* *void* updatePhysics()

{

*if*(boxx  10){

direction = *DIRECTION_RIGHT*;

}

*else* *if*(boxx  250){

direction = *DIRECTION_LEFT*;

}

*if*(boxy  10){

direction = *DIRECTION_DOWN*;

}

*else* *if*(boxy  350){

direction = *DIRECTION_UP*;

}

*if*(direction == *DIRECTION_RIGHT*){

boxx = boxx + 10;

}

*else* *if* (direction == *DIRECTION_LEFT*)

{

boxx = boxx - 10;

}

*else* *if*(direction == *DIRECTION_UP*){

boxy = boxy - 10;

}

*else* *if*(direction == *DIRECTION_DOWN*){

boxy = boxy + 10;

}

*else*{

//Do nothing

}

}

*private* *synchronized* *void* doDraw(Canvas canvas, Paint paint)

{

*if*(start)

{

canvas.drawColor(Color.*GREEN*);

canvas.drawBitmap(scratch,10,10,paint);

start = *false*;

}

*else
*

{

canvas.save();

canvas.clipRect(boxx,boxy,boxx+30,boxy+30);

canvas.drawColor(Color.*RED*);

canvas.drawBitmap(scratch,boxx,boxy,paint);

canvas.restore();

}

}

//@Override

*public* *boolean* onKeyDown(*int* keyCode, KeyEvent event){

*if*(keyCode == KeyEvent.*KEYCODE_DPAD_CENTER*){

*if*(running!=*true*){

running = *true*;

}

*else*{

running = *false*;

}

}

*else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_LEFT*){

direction = *DIRECTION_LEFT*;

}

*else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_RIGHT*){

direction = *DIRECTION_RIGHT*;

}

*else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_DOWN*){

direction = *DIRECTION_DOWN*;

}

*else* *if* (keyCode == KeyEvent.*KEYCODE_DPAD_UP*){

direction = *DIRECTION_UP*;

}

*else* *if*(keyCode == KeyEvent.*KEYCODE_BACK*){

finish();

}

*return* *true*;

}

*class* Panel *extends* View

{

Paint paint;

*public* Panel(Context context)

{

*super*(context);

paint = *new* Paint();

}

@Override

*protected* *void* onDraw(Canvas canvas)

{

doDraw(canvas,paint);

}

}

*class* AnimationLoop *implements* Runnable

{

*public* *void* run()

{

*while*(*true*)

{

*while*(running)

{

*try
*

{

Thread.*sleep*(100);

}

*catch*(InterruptedException ex) {}

updatePhysics();

main.postInvalidate();

}

}

}

}

*class* Refresh *implements* Runnable{

*public* *void* run(){

*while*(!Thread.*currentThread*().isInterrupted()){

Message message = *new* Message();

message.what = Testing.*GUIUPDATEIDENTIFIER*;

Testing.*this*.GUIUpdateHandler.sendMessage(message);

*try*{

Thread.*sleep*(100);

}

*catch* (Exception e) {

Thread.*currentThread*().interrupt();

}

}

}

}

}
my another class file:
*RandomView.java*

**
*

package* com.paad.testing;

*

import* android.content.Context;
*

import* android.graphics.Canvas;
*

import* android.graphics.Color;
*

import* android.graphics.Point;
*

import* android.graphics.drawable.Drawable;
*

import* android.view.View;

*

public* *class* RandomView *extends* View{

*protected* Drawable myPosition;

*protected* Point myPoint = *new* Point(10,10);

*protected* *enum* HorizontalDirection{*LEFT*,*RIGHT*}

*protected* *enum* VerticalDirection{*UP*,*DOWN*}

*protected* HorizontalDirection myXDirection = HorizontalDirection.*RIGHT*;

*protected* VerticalDirection myYDirection = VerticalDirection.*UP*;

*public* RandomView(Testing testing) {

*super*((Context)testing);

*this*.setBackgroundColor(Color.*BLUE*);

*this*.myPosition = *this*.getResources().getDrawable(R.drawable.*greenball*
);

}

*public* 

Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread Sandeep Phansekar
Hi

Just Change the *android:versionCode=1.1*  present in the mainfest.xml
file

regards
sandeep


On Mon, Sep 6, 2010 at 5:39 PM, Dhrumil Shah dhrumilsh...@gmail.com wrote:

 I developed one game its code is here:

 *Testing.java*
 *

 package
 * com.paad.testing;

 *

 import
 * android.app.Activity;*

 import
 * android.os.Bundle;*

 import
 * android.os.Handler;*

 import
 * android.os.Message;*

 import
 * android.view.*;*

 import
 * android.graphics.*;*

 import
 * android.content.*;

 *

 public
 * *class* Testing *extends* Activity {

 RandomView
 randomView = *null*;

 *public* *static* *final* *int* *DIRECTION_RIGHT* = 0, *DIRECTION_LEFT* =
 1, *DIRECTION_DOWN* = 2, *DIRECTION_UP* = 3;

 *protected* *static* *final* *int* *GUIUPDATEIDENTIFIER* = 0x101;

 *private* Panel main;

 *private* Bitmap scratch;

 *private* Canvas offscreen;

 *public* *boolean* start = *true*;

 *private* *volatile* *boolean* running = *false*;

 *private* *int* direction = *DIRECTION_RIGHT*;

 *private* *int* boxx = 10;

 *private* *int* boxy = 10;

 Thread
 myRefreshThread = *null*;

 Handler
 GUIUpdateHandler = *new* Handler() {

 // @Override

 *public* *void* handleMessage(Message msg) {

 *switch* (msg.what) {

 *case* Testing.*GUIUPDATEIDENTIFIER*:

 randomView.invalidate();

 *break*;

 }

 *super*.handleMessage(msg);

 }

 };

 @Override

 *public* *void* onCreate(Bundle savedInstanceState)

 {

 *super*.onCreate(savedInstanceState);

 *this*.randomView = *new* RandomView(*this*);

 *this*.setContentView(*this*.randomView);

 (
 *new* Thread(*new* Refresh())).start();

 setOffscreenBitmap();

 main = *new* Panel(*this*);

 setContentView(
 main,*new* ViewGroup.LayoutParams(320,480));

 (
 *new* Thread(*new* AnimationLoop())).start();

 }

 *private* *void* setOffscreenBitmap()

 {

 scratch = Bitmap.*createBitmap*(30,30,Bitmap.Config.*ARGB_*);

 offscreen = *new* Canvas();

 offscreen.setBitmap(scratch);

 offscreen.drawColor(Color.*RED*);

 }

 *private* *synchronized* *void* updatePhysics()

 {

 *if*(boxx  10){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(boxx  250){

 direction = *DIRECTION_LEFT*;

 }

 *if*(boxy  10){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if*(boxy  350){

 direction = *DIRECTION_UP*;

 }

 *if*(direction == *DIRECTION_RIGHT*){

 boxx = boxx + 10;

 }

 *else* *if* (direction == *DIRECTION_LEFT*)

 {

 boxx = boxx - 10;

 }

 *else* *if*(direction == *DIRECTION_UP*){

 boxy = boxy - 10;

 }

 *else* *if*(direction == *DIRECTION_DOWN*){

 boxy = boxy + 10;

 }

 *else*{

 //Do nothing

 }

 }

 *private* *synchronized* *void* doDraw(Canvas canvas, Paint paint)

 {

 *if*(start)

 {

 canvas.drawColor(Color.
 *GREEN*);

 canvas.drawBitmap(
 scratch,10,10,paint);

 start = *false*;

 }

 *else*

 {

 canvas.save();

 canvas.clipRect(
 boxx,boxy,boxx+30,boxy+30);

 canvas.drawColor(Color.
 *RED*);

 canvas.drawBitmap(
 scratch,boxx,boxy,paint);

 canvas.restore();

 }

 }

 //@Override

 *public* *boolean* onKeyDown(*int* keyCode, KeyEvent event){

 *if*(keyCode == KeyEvent.*KEYCODE_DPAD_CENTER*){

 *if*(running!=*true*){

 running = *true*;

 }

 *else*{

 running = *false*;

 }

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_LEFT*){

 direction = *DIRECTION_LEFT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_RIGHT*){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_DOWN*){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if* (keyCode == KeyEvent.*KEYCODE_DPAD_UP*){

 direction = *DIRECTION_UP*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_BACK*){

 finish();

 }

 *return* *true*;

 }

 *class* Panel *extends* View

 {

 Paint
 paint;

 *public* Panel(Context context)

 {

 *super*(context);

 paint = *new* Paint();

 }

 @Override

 *protected* *void* onDraw(Canvas canvas)

 {

 doDraw(canvas,
 paint);

 }

 }

 *class* AnimationLoop *implements* Runnable

 {

 *public* *void* run()

 {

 *while*(*true*)

 {

 *while*(running)

 {

 *try*

 {

 Thread.*sleep*(100);

 }

 *catch*(InterruptedException ex) {}

 updatePhysics();

 main.postInvalidate();

 }

 }

 }

 }

 *class* Refresh *implements* Runnable{

 *public* *void* run(){

 *while*(!Thread.*currentThread*().isInterrupted()){

 Message message =
 *new* Message();

 message.
 what = Testing.*GUIUPDATEIDENTIFIER*;

 Testing.
 *this*.GUIUpdateHandler.sendMessage(message);

 *try*{

 Thread.*sleep*(100);

 }

 *catch* (Exception e) {

 Thread.*currentThread*().interrupt();

 }

 }

 }

 }

 }
 my another class file:
 *RandomView.java*

 **
 *

 package
 * com.paad.testing;

 *

 import
 * android.content.Context;*

 import
 * android.graphics.Canvas;*

 import
 * android.graphics.Color;*

 import
 * android.graphics.Point;*

 import
 * android.graphics.drawable.Drawable;*

 import
 * android.view.View;

 *

 public
 * *class* RandomView *extends* View{

 *protected* Drawable myPosition;

 *protected* Point myPoint = *new* Point(10,10);

 *protected* *enum* 

Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread Dhrumil Shah
Hi Sandeep,

I try to change it, but it shows an error like this:

error: Error: Float types not allowed (at 'versionCode' with value '1.1').
~Dhrumil

On Mon, Sep 6, 2010 at 5:59 PM, Sandeep Phansekar 
sandeep.phanse...@gmail.com wrote:

 Hi

 Just Change the *android:versionCode=1.1*  present in the mainfest.xml
 file

 regards
 sandeep


   On Mon, Sep 6, 2010 at 5:39 PM, Dhrumil Shah dhrumilsh...@gmail.comwrote:

   I developed one game its code is here:

 *Testing.java*
 *

 package
 *com.paad.testing;

 *

 import
 *android.app.Activity;*

 import
 *android.os.Bundle;*

 import
 *android.os.Handler;*

 import
 *android.os.Message;*

 import
 *android.view.*;*

 import
 *android.graphics.*;*

 import
 *android.content.*;

 *

 public
 **class* Testing *extends* Activity {

 RandomView
 randomView = *null*;

 *public* *static* *final* *int* *DIRECTION_RIGHT* = 0, *DIRECTION_LEFT* =
 1, *DIRECTION_DOWN* = 2, *DIRECTION_UP* = 3;

 *protected* *static* *final* *int* *GUIUPDATEIDENTIFIER* = 0x101;

 *private* Panel main;

 *private* Bitmap scratch;

 *private* Canvas offscreen;

 *public* *boolean* start = *true*;

 *private* *volatile* *boolean* running = *false*;

 *private* *int* direction = *DIRECTION_RIGHT*;

 *private* *int* boxx = 10;

 *private* *int* boxy = 10;

 Thread
 myRefreshThread = *null*;

 Handler
 GUIUpdateHandler = *new* Handler() {

 // @Override

 *public* *void* handleMessage(Message msg) {

 *switch* (msg.what) {

 *case* Testing.*GUIUPDATEIDENTIFIER*:

 randomView.invalidate();

 *break*;

 }

 *super*.handleMessage(msg);

 }

 };

 @Override

 *public* *void* onCreate(Bundle savedInstanceState)

 {

 *super*.onCreate(savedInstanceState);

 *this*.randomView = *new* RandomView(*this*);

 *this*.setContentView(*this*.randomView);

 (
 *new* Thread(*new* Refresh())).start();

 setOffscreenBitmap();

 main = *new* Panel(*this*);

 setContentView(
 main,*new* ViewGroup.LayoutParams(320,480));

 (
 *new* Thread(*new* AnimationLoop())).start();

 }

 *private* *void* setOffscreenBitmap()

 {

 scratch = Bitmap.*createBitmap*(30,30,Bitmap.Config.*ARGB_*);

 offscreen = *new* Canvas();

 offscreen.setBitmap(scratch);

 offscreen.drawColor(Color.*RED*);

 }

 *private* *synchronized* *void* updatePhysics()

 {

 *if*(boxx  10){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(boxx  250){

 direction = *DIRECTION_LEFT*;

 }

 *if*(boxy  10){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if*(boxy  350){

 direction = *DIRECTION_UP*;

 }

 *if*(direction == *DIRECTION_RIGHT*){

 boxx = boxx + 10;

 }

 *else* *if* (direction == *DIRECTION_LEFT*)

 {

 boxx = boxx - 10;

 }

 *else* *if*(direction == *DIRECTION_UP*){

 boxy = boxy - 10;

 }

 *else* *if*(direction == *DIRECTION_DOWN*){

 boxy = boxy + 10;

 }

 *else*{

 //Do nothing

 }

 }

 *private* *synchronized* *void* doDraw(Canvas canvas, Paint paint)

 {

 *if*(start)

 {

 canvas.drawColor(Color.
 *GREEN*);

 canvas.drawBitmap(
 scratch,10,10,paint);

 start = *false*;

 }

 *else*

 {

 canvas.save();

 canvas.clipRect(
 boxx,boxy,boxx+30,boxy+30);

 canvas.drawColor(Color.
 *RED*);

 canvas.drawBitmap(
 scratch,boxx,boxy,paint);

 canvas.restore();

 }

 }

 //@Override

 *public* *boolean* onKeyDown(*int* keyCode, KeyEvent event){

 *if*(keyCode == KeyEvent.*KEYCODE_DPAD_CENTER*){

 *if*(running!=*true*){

 running = *true*;

 }

 *else*{

 running = *false*;

 }

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_LEFT*){

 direction = *DIRECTION_LEFT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_RIGHT*){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_DOWN*){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if* (keyCode == KeyEvent.*KEYCODE_DPAD_UP*){

 direction = *DIRECTION_UP*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_BACK*){

 finish();

 }

 *return* *true*;

 }

 *class* Panel *extends* View

 {

 Paint
 paint;

 *public* Panel(Context context)

 {

 *super*(context);

 paint = *new* Paint();

 }

 @Override

 *protected* *void* onDraw(Canvas canvas)

 {

 doDraw(canvas,
 paint);

 }

 }

 *class* AnimationLoop *implements* Runnable

 {

 *public* *void* run()

 {

 *while*(*true*)

 {

 *while*(running)

 {

 *try*

 {

 Thread.*sleep*(100);

 }

 *catch*(InterruptedException ex) {}

 updatePhysics();

 main.postInvalidate();

 }

 }

 }

 }

 *class* Refresh *implements* Runnable{

 *public* *void* run(){

 *while*(!Thread.*currentThread*().isInterrupted()){

 Message message =
 *new* Message();

 message.
 what = Testing.*GUIUPDATEIDENTIFIER*;

 Testing.
 *this*.GUIUpdateHandler.sendMessage(message);

 *try*{

 Thread.*sleep*(100);

 }

 *catch* (Exception e) {

 Thread.*currentThread*().interrupt();

 }

 }

 }

 }

 }
 my another class file:
 *RandomView.java*

 **
 *

 package
 *com.paad.testing;

 *

 import
 *android.content.Context;*

 import
 *android.graphics.Canvas;*

 import
 *android.graphics.Color;*

 import
 *android.graphics.Point;*

 import
 

Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread { Devdroid }
On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com wrote:
 Hi Sandeep,

 I try to change it, but it shows an error like this:

 error: Error: Float types not allowed (at 'versionCode' with value '1.1').

You should not change things you do not understand in hope it will work
even you do not know why. There's clear error message quoted above
and there's manual you shall read to get what value is valid there:
http://developer.android.com/guide/publishing/versioning.html

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en