[android-beginners] Adding a view to a viewgroup
I'm trying to do some simple UI stuff in a game (Basketball). I've created my own Court class (which extends ViewGroup) and I want to add a Ball (extends View) to the court. Unfortunately my ball doesn't show up on the court, and in fact the court doesn't draw either. What have I done wrong? package test.com; import android.app.Activity; import android.os.Bundle; import android.view.ViewGroup.LayoutParams; import android.widget.FrameLayout; import android.widget.LinearLayout; public class test extends Activity { /** Constants */ final int FPAR = LinearLayout.LayoutParams.FILL_PARENT; private FrameLayout main; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.addContentView(new Court(this), new LayoutParams(FPAR, FPAR)); } } package test.com; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.view.ViewGroup; public class Court extends ViewGroup { // court dimensions private int height = 0; private int width = 0; private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); // ball Ball ball; public Court(Context context) { super(context); } @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); // fix the sizes here height = this.getMeasuredHeight(); width = this.getMeasuredWidth(); this.layout(0, 0, width, height); // create a new ball ball = new Ball(this, 100, 100, 20, Color.RED); // put a ball on the court this.addView(ball); } @Override public void onDraw(Canvas canvas) { paint.setColor(Color.RED); Rect rect = new Rect(this.getLeft(), this.getTop(), width, height); canvas.drawRect(rect, paint); // tell the ball to draw itself ball.draw(canvas); } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { // TODO Auto-generated method stub } } package test.com; import android.graphics.Canvas; import android.graphics.Paint; import android.view.MotionEvent; import android.view.View; public class Ball extends View { private int x; private int y; private int r; private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); public Ball(Court court, int x, int y, int r, int color) { super(court.getContext()); mPaint.setColor(color); this.x = x; this.y = y; this.r = r; this.layout(this.x, this.y, this.x + (r * 2), this.y + (2 * r)); this.setOnTouchListener(this.ballTouchListener); } private OnTouchListener ballTouchListener = new OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent event) { // get the location of the click int X = (int)event.getRawX(); int Y = (int)event.getRawY(); Ball ball = (Ball)view; // do stuff, depending on what type of touch motion is occurring switch (event.getAction()) { case MotionEvent.ACTION_DOWN: break; case MotionEvent.ACTION_MOVE: ball.layout(X, Y, X + ball.getWidth(), Y + ball.getHeight()); break; case MotionEvent.ACTION_UP: break; } return true; } }; @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawCircle(this.getLeft(), this.getTop(), this.r, mPaint); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--
[android-beginners] Re: Samsung I7500 ADB connection problem
OK i know. On Jun 26, 11:53 am, jz0o0z wrote: > I had the same problem until I realizedSamsunguses their own adb. > You should be able to get the drivers and correct adb from the person > that sent you the device. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Adding a view to a viewgroup
Your Court.onDraw() function will not get called by default for efficiency. You need to call setWillNotDraw(false) to enable it. -- Jack Ha Open Source Development Center ・T・ ・ ・Mobile・ stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 7, 5:30 am, Carl wrote: > I'm trying to do some simple UI stuff in a game (Basketball). > > I've created my own Court class (which extends ViewGroup) and I want > to add a Ball (extends View) to the court. > > Unfortunately my ball doesn't show up on the court, and in fact the > court doesn't draw either. > > What have I done wrong? > > package test.com; > > import android.app.Activity; > import android.os.Bundle; > import android.view.ViewGroup.LayoutParams; > import android.widget.FrameLayout; > import android.widget.LinearLayout; > > public class test extends Activity > { > /** Constants */ > final int FPAR = LinearLayout.LayoutParams.FILL_PARENT; > > private FrameLayout main; > > /** Called when the activity is first created. */ > @Override > public void onCreate(Bundle savedInstanceState) > { > super.onCreate(savedInstanceState); > this.addContentView(new Court(this), new LayoutParams(FPAR, > FPAR)); > } > > } > > package test.com; > > import android.content.Context; > import android.graphics.Canvas; > import android.graphics.Color; > import android.graphics.Paint; > import android.graphics.Rect; > import android.view.ViewGroup; > > public class Court extends ViewGroup > { > // court dimensions > private int height = 0; > private int width = 0; > private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); > > // ball > Ball ball; > > public Court(Context context) > { > super(context); > } > > @Override > public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) > { > super.onMeasure(widthMeasureSpec, heightMeasureSpec); > > // fix the sizes here > height = this.getMeasuredHeight(); > width = this.getMeasuredWidth(); > this.layout(0, 0, width, height); > > // create a new ball > ball = new Ball(this, 100, 100, 20, Color.RED); > > // put a ball on the court > this.addView(ball); > } > > @Override > public void onDraw(Canvas canvas) > { > paint.setColor(Color.RED); > Rect rect = new Rect(this.getLeft(), this.getTop(), width, > height); > canvas.drawRect(rect, paint); > // tell the ball to draw itself > ball.draw(canvas); > } > > @Override > protected void onLayout(boolean changed, int l, int t, int r, int b) > { > // TODO Auto-generated method stub > } > > } > > package test.com; > > import android.graphics.Canvas; > import android.graphics.Paint; > import android.view.MotionEvent; > import android.view.View; > > public class Ball extends View > { > private int x; > private int y; > private int r; > private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); > > public Ball(Court court, int x, int y, int r, int color) > { > super(court.getContext()); > mPaint.setColor(color); > this.x = x; > this.y = y; > this.r = r; > this.layout(this.x, this.y, this.x + (r * 2), this.y + (2 * > r)); > this.setOnTouchListener(this.ballTouchListener); > } > > private OnTouchListener ballTouchListener = new OnTouchListener() > { > @Override > public boolean onTouch(View view, MotionEvent event) > { > // get the location of the click > int X = (int)event.getRawX(); > int Y = (int)event.getRawY(); > > Ball ball = (Ball)view; > > // do stuff, depending on what type of touch motion > is occurring > switch (event.getAction()) > { > case MotionEvent.ACTION_DOWN: > break; > case MotionEvent.ACTION_MOVE: > ball.layout(X, Y, X + > ball.getWidth(), Y + ball.getHeight()); > break; > case MotionEvent.ACTION_UP: > break; > } > return true; >
[android-beginners] Re: ItemizedOverlay
You'll need to post at least some of your code so that we can see what you're doing On Jul 5, 8:56 pm, Arvind wrote: > Hello to all.. > > After many unsuccesful attempts on ItemizedOverlay...the sample code > provided by google Im here begging for help... > Ive obtained key... got internet permissions sorted... > have the map appearing on the screen... > Only that the overlay marker does not appear... > Please solve my problem. Im really stuck Ive seen ppl on the > group whove got that working... It wont take much time.. > Please help me out... wasted a whole week on it with no reply.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: connection via adb
Sorry about this - I found the problem. Regards, On Mon, Jul 6, 2009 at 3:34 PM, blackfrancis wrote: > Hello, > I see posts about this scattered everywhere, so I apologise that this > is somewhat travelled ground, but I haven't been able to find > categorical answers to my questions. > I bought a G1 recently and downloaded the Android SDK. I have a Mac > and a PC, and I installed the SDK for each. > When I connect and try to see my device using 'sudo adb devices' on my > Mac, I get "List of devices attached" with no entries. > On my PC, when I plugged the phone in I saw a popup in the System > Tray that said 'Android phone' but I didnt get the chance to install > the drivers that came with the SDK for XP, and again when I run 'adb > devices' I get "List of devices attached" with no entries. > Do I need to change the firmware that my phone is running? My > firmware is 1.1, baseband 62.33.20.08H, Kernel 2.6.25, build kila-user > 1.1 plat-rc33. > Thanks in advance for any help getting my phone connected. > Cheers, -- George Francis e-mail: gfranc...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] GUI test tool/framework for Android?
Hi All, I need to interact with my Android application through its GUI in order to test it. Is there any tool/framework available which can be used to perform various user actions on the UI elements/controls like a button click, read/write some text into a textbox etc.? There is an "Android Instrumentation Framework" (part of SDK) but that's more for API or Unit testing not for functional testing. Thanks Yasser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] GUI test tool/framework for Android?
I need to interact with my Android application through its GUI in order to test it. Is there any tool/framework available which can be used to perform various user actions on the UI elements/controls like a button click, read/write some text into a textbox etc.? There is an "Android Instrumentation Framework" (part of SDK) but that's more for API or Unit testing not for functional testing. Thanks Yasser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] connection via adb
Hello, I see posts about this scattered everywhere, so I apologise that this is somewhat travelled ground, but I haven't been able to find categorical answers to my questions. I bought a G1 recently and downloaded the Android SDK. I have a Mac and a PC, and I installed the SDK for each. When I connect and try to see my device using 'sudo adb devices' on my Mac, I get "List of devices attached" with no entries. On my PC, when I plugged the phone in I saw a popup in the System Tray that said 'Android phone' but I didnt get the chance to install the drivers that came with the SDK for XP, and again when I run 'adb devices' I get "List of devices attached" with no entries. Do I need to change the firmware that my phone is running? My firmware is 1.1, baseband 62.33.20.08H, Kernel 2.6.25, build kila-user 1.1 plat-rc33. Thanks in advance for any help getting my phone connected. Cheers, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Android 1.5 - getNeighboringCellInfo() always returns 0 neighboring cells
Has anyone been able to retrieve the neighbor cell information using a G1 or ADP phone? I'm using android-sdk-linux_x86-1.5_r2 and compiling against API level 3 (Android 1.5). The application builds correctly but every time I request the neighboring cells as listed below, it returns a list of 0 neighbors. If I look at the radio log buffer, I can see the request being made to the RIL layer. Is anyone else seeing this? Here are the permissions in AndroidManifest.xml Here is the code: // Retrieve the telephony manager mTelephonyManager = (TelephonyManager)getSystemService (Context.TELEPHONY_SERVICE); // Get the neighbor cell information ArrayList neighbors = (ArrayList) mTelephonyManager.getNeighboringCellInfo(); Log.d(TAG, "Number Of Neighbors: " + neighbors.size()); // Print out the neighbor cells for (NeighboringCellInfo neighboringCellInfo : neighbors) { Log.d(TAG, "NeighborCell: " + neighboringCellInfo); } Any help would be greatly appreciated! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] ListView: Default highlight the item
Hello I am using ListView in my application. When My application gets launched, it displays Listview with some items in the list. I want the first item to be highlighted by default without any user action. How can i do that ? I tried listview.setSelection(0) method but it is not actually highlighting that first item. Can someone help me on this ? -PD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Updating items in ListView
Hi all! I have a ListView (to be more exact I have a ListActivity) and the list receives it's info from a remote source in a separate thread. The list first just receive a list of integers and then I'd like to send separate requests for the list items data that are visible. So, I guess I have 2 questions: 1. How do I know what items are visible? Is it only the items that are requested through the adapters getView? 2. Since it takes a little while from the moment an item gets visible until it actually have it's visible data loaded: How do I tell the List/Adapter to invalidate/redraw one item in the list? Best regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] MapView drag delay
Hello, I have a question regarding the mapview and it's drag delay! At least on the emulator, when you drag the map around in a MapView it will lag for a few pixels before it starts to move. I'm guessing this is because it need some a initial calculations or something, but I wonder if you KNOW why this delay is and if there is any possibility to remove it? // Kalle --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Problem on animation
Hi All, I am working on Animation but really don't know how to modify Somefile.xml file in Res directory. More explicitly I have a somefile.xml in my Res directory and I want to Modify it at runtime. How can I do it. Code wise: nGame = (Button)findViewById(R.id.New_Game); contiGame = (Button)findViewById(R.id.Continue_Game); Options = (Button)findViewById(R.id.Options); Animation anim = AnimationUtils.loadAnimation(this, R.anim.slide_right); //anim = AnimationUtils.loadAnimation (this, R.anim.rotate); anim.setRepeatMode (Animation.INFINITE); // Play the animation. nGame.startAnimation(anim); contiGame.startAnimation(anim); Options.startAnimation(anim); Somefile.xml http://schemas.android.com/apk/res/android"; android:interpolator="@android:anim/accelerate_interpolator"> So instead of having 3 menu's I just see one menu cause each menu is placed on the top of other. Now I wish if thr is any way I could modify Somefile.xml or any other way to solve this problem. Thanks in advnace Best Regards Ash --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Images are not saved properly
Hi i need help.i have created a camera application using android sdk 1.5.it works like this when open the application you have to click a button named "click" .When you click it camera will open and under the camera preview(another layer) thier is an button called "Take Pictuer". When you click the button camera takes the pictuer.it wokes fine to this point. I want to save the image in the Gallery in my dev phone 1. when i open the Gallery it will show the image with the resolution i set.But image has no pictuer and it is a black. no image is available This is my code package img.cam; import java.io.FileNotFoundException; import java.io.IOException; import java.io.OutputStream; import android.app.Activity; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Bitmap.CompressFormat; import android.hardware.Camera; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.provider.MediaStore.Images; import android.provider.MediaStore.Images.Media; import android.util.Log; import android.view.KeyEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.LinearLayout; public class imgCam extends Activity { /** Called when the activity is first created. */ private Preview mPreview; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button butt=(Button)findViewById(R.id.button); butt.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub mPreview = new Preview(getApplicationContext()); LinearLayout layout = new LinearLayout(getApplicationContext ()); LinearLayout layoutcam = new LinearLayout (getApplicationContext()); LinearLayout layoutbot = new LinearLayout (getApplicationContext()); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams ( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams ( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); lp.height=360; lp2.height=60; layout.setOrientation(LinearLayout.VERTICAL); layoutcam.addView(mPreview); Button btn = new Button(getApplicationContext()); btn.setWidth(120); btn.setText("Take Pictuer"); layoutbot.addView(btn); layout.addView(layoutcam,lp); layout.addView(layoutbot,lp2); setContentView(layout); //listner for the button below camera btn.setOnClickListener(new OnClickListener(){ public void onClick(View v) { mPreview.pictake(); //save part ContentValues values = new ContentValues(); values.put(Images.Media.TITLE, "title"); values.put(Images.Media.BUCKET_ID, "test"); values.put(Images.Media.DESCRIPTION, "test Image taken"); values.put(Images.Media.MIME_TYPE, "image/jpeg"); Uri imageUri = getContentResolver().insert (Media.EXTERNAL_CONTENT_URI, values); OutputStream outstream; // Bitmap myPic = Bitmap.createBitmap(320, 240, false); Bitmap mypic=Bitmap.createBitmap(2048, 1536,Bitmap.Config.RGB_565); try { outstream = getContentResolver().openOutputStream(imageUri); mypic.compress(CompressFormat.JPEG, 25, outstream); outstream.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) {
[android-beginners] DDMS telephony actions on real connected device?
Is this possible? The actions seem greyed out both in eclipse and in the stand alone DDMS debugger --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Unable to initialize Repo client
Hello We have some problem to initialize the repo client. I have downloaded the repo script and made it executable. After running the Repo init, it repeatedly asks to enter the name and email address. Please let me know if I am missing to do something else before running repo init. Thanks in advance. Chandru --- Robosoft Technologies - Come home to Technology Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: File operations
hi i am not understnding this code.can anyone help me and explain me this code .thank u /* Create an Intent to start * MySecondActivity. */ Intent i = *new* Intent( StartingSubactivities.*this*,SecondActivity.*class* *)*; /* Send intent to the OS to make * * it aware that we want to start * * MySecondActivity as a SubActivity. */ startSubActivity(i, 0x1337); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Android 1.5 - getNeighboringCellInfo() always returns 0 neighboring cells
Hi, I've been trying to retrieve the neighboring cell information using my ADP phone, but when I call getNeighboringCellInfo() it always returns list of size 0. I'm using the android-sdk-linux_x86-1.5_r2 and compiling for a 1.5 device(API Level 3). Has anyone else seen this, or am I doing something wrong? Permissions in AndroidManifest.xml Here's the code: // Retrieve the telephony manager mTelephonyManager = (TelephonyManager)getSystemService (Context.TELEPHONY_SERVICE); // Get the neighbor cell information ArrayList neighbors = (ArrayList) mTelephonyManager.getNeighboringCellInfo(); Log.d(TAG, "Number Of Neighbors: " + neighbors.size()); // Print out the neighbor cells for (NeighboringCellInfo neighboringCellInfo : neighbors) { Log.d(TAG, "NeighborCell: " + neighboringCellInfo); } Any help would be greatly appreciated! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Is it possible to include the cupcake plugins jar into my app?
Hi All, I'm developing an app for the google challenge, my problem is that I'm relying on the MapView which is still not on any market device (I think). Seen that to win, people must vote for you, no one will be able to install the app on his phone. Is the MapVien including native calls? otherwise did someone try to integrate the plugins jar into his app? Any feedbak is very welcome, Regards, Zied Hamdi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: problem starting emulator from command line
hello, i am a beginner too,and I have the same anonying problem as you .my enviroment is 32-vista and android sdk 1.5 r1. if you get some solution,please inform me .thank you very much . 2009/7/6 greg > > The reason the android emulator starting from within Eclipse did not > appear to have some emulator options available is that I did not fully > extend the window shown in response to the Eclipse "Run/Run > Configurations/Target" menu item. Vertically extending that window > revealed the "Additional Emulator Command Line Options" field. > > The reason for the emulator not starting from the (64-bit Vista) > command line is still a mystery. I'll post that problem to the > Android Issue Tracker if I don't get any tips from the group. > > - Greg > > On Jul 6, 11:18 am, greg wrote: > > Although I can reliably start the android emulator from within Eclipse > > (version 3.4.2), I would like to use some emulator options (e.g., - > > scale) that don't appear to be available from within Eclipse. However > > I get a Microsoft Windows error dialog displaying "emulator.exe has > > stopped working" whenever I try to start the emulator using the > > command line "emulator -avd my_avd" > > > > If I disconnect the network, in addition to the "emulator.exe has > > stopped working" dialog, the command line response is "Warning: No DNS > > servers found". Note that the android emulator starts avd my_avd > > reliably from within Eclipse with or without a network connection. > > > > This problem is occurring on the android 1.5 platform running on 64- > > bit Vista. > > > > There was a reference to a seemingly similar problem athttp:// > groups.google.com/group/android-developers/browse_thread/threa..., > > but I didn't see any resolution to it. > > > > By the way, I think the android development environment and > > documentation is very impressive, especially considering how new it > > is. I did happen to notice a couple typos in the SDK's emulator > > documentation athttp:// > developer.android.com/guide/developing/tools/emulator.html: > > > > -- "files tht you want" > > -- "control the its behaviors" > > > > Best regards, > > Greg > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView: Default highlight the item
Launch the application using the trackball :) On Mon, Jul 6, 2009 at 10:38 AM, pdesai wrote: > > Hello > > I am using ListView in my application. When My application gets > launched, it displays Listview with some items in the list. I want the > first item to be highlighted by default without any user action. How > can i do that ? > > I tried listview.setSelection(0) method but it is not actually > highlighting that first item. > > Can someone help me on this ? > > -PD > > > > -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: No output on the eclipse console
In eclipse you can see console output by Using util.log log options are four types debug,error,info,... if you want to switch to the log outputs in eclipse windows->show view->other->android->logcat now you can log outputs --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: No output on the eclipse console
Thanks Katheek. It worked. -chinna On Tue, Jul 7, 2009 at 8:39 AM, kartheek karthikeya wrote: > > > In eclipse you can see console output by Using util.log > log options are four types debug,error,info,... > if you want to switch to the log outputs in eclipse > windows->show view->other->android->logcat > now you can log outputs > > > > > > -- Thanks and Regards Chinnadurai M --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: GUI test tool/framework for Android?
If you are using eclipse to dev then you know the emulator is all part of what you are looking for. If you are not using eclipse then you should probably start using it. Go to http://eclipsesource.com/en/yoxos/yoxos-ondemand/ and roll your own eclipse install with all the android, svn, jUnit stuff or whatever you like and you should be good to go. g On Mon, Jul 6, 2009 at 6:37 PM, Yasser wrote: > > I need to interact with my Android application through its GUI in > order to test it. > > Is there any tool/framework available which can be used to perform > various user actions on the UI elements/controls like a button click, > read/write some text into a textbox etc.? > > There is an "Android Instrumentation Framework" (part of SDK) but > that's more for API or Unit testing not for functional testing. > > > Thanks > Yasser > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Adding a view to a viewgroup
Excellent, thanks. On 7 July, 17:17, Jack Ha wrote: > Your Court.onDraw() function will not get called by default for > efficiency. You need to call setWillNotDraw(false) to enable it. > > -- > Jack Ha > Open Source Development Center > ・T・ ・ ・Mobile・ stick together > > The views, opinions and statements in this email are those of > the author solely in their individual capacity, and do not > necessarily represent those of T-Mobile USA, Inc. > > On Jul 7, 5:30 am, Carl wrote: > > > > > I'm trying to do some simple UI stuff in a game (Basketball). > > > I've created my own Court class (which extends ViewGroup) and I want > > to add a Ball (extends View) to the court. > > > Unfortunately my ball doesn't show up on the court, and in fact the > > court doesn't draw either. > > > What have I done wrong? > > > package test.com; > > > import android.app.Activity; > > import android.os.Bundle; > > import android.view.ViewGroup.LayoutParams; > > import android.widget.FrameLayout; > > import android.widget.LinearLayout; > > > public class test extends Activity > > { > > /** Constants */ > > final int FPAR = LinearLayout.LayoutParams.FILL_PARENT; > > > private FrameLayout main; > > > /** Called when the activity is first created. */ > > @Override > > public void onCreate(Bundle savedInstanceState) > > { > > super.onCreate(savedInstanceState); > > this.addContentView(new Court(this), new LayoutParams(FPAR, > > FPAR)); > > } > > > } > > > package test.com; > > > import android.content.Context; > > import android.graphics.Canvas; > > import android.graphics.Color; > > import android.graphics.Paint; > > import android.graphics.Rect; > > import android.view.ViewGroup; > > > public class Court extends ViewGroup > > { > > // court dimensions > > private int height = 0; > > private int width = 0; > > private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); > > > // ball > > Ball ball; > > > public Court(Context context) > > { > > super(context); > > } > > > @Override > > public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) > > { > > super.onMeasure(widthMeasureSpec, heightMeasureSpec); > > > // fix the sizes here > > height = this.getMeasuredHeight(); > > width = this.getMeasuredWidth(); > > this.layout(0, 0, width, height); > > > // create a new ball > > ball = new Ball(this, 100, 100, 20, Color.RED); > > > // put a ball on the court > > this.addView(ball); > > } > > > @Override > > public void onDraw(Canvas canvas) > > { > > paint.setColor(Color.RED); > > Rect rect = new Rect(this.getLeft(), this.getTop(), width, > > height); > > canvas.drawRect(rect, paint); > > // tell the ball to draw itself > > ball.draw(canvas); > > } > > > @Override > > protected void onLayout(boolean changed, int l, int t, int r, int b) > > { > > // TODO Auto-generated method stub > > } > > > } > > > package test.com; > > > import android.graphics.Canvas; > > import android.graphics.Paint; > > import android.view.MotionEvent; > > import android.view.View; > > > public class Ball extends View > > { > > private int x; > > private int y; > > private int r; > > private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); > > > public Ball(Court court, int x, int y, int r, int color) > > { > > super(court.getContext()); > > mPaint.setColor(color); > > this.x = x; > > this.y = y; > > this.r = r; > > this.layout(this.x, this.y, this.x + (r * 2), this.y + (2 * > > r)); > > this.setOnTouchListener(this.ballTouchListener); > > } > > > private OnTouchListener ballTouchListener = new OnTouchListener() > > { > > @Override > > public boolean onTouch(View view, MotionEvent event) > > { > > // get the location of the click > > int X = (int)event.getRawX(); > > int Y = (int)event.getRawY(); > > > Ball ball = (Ball)view; > > > // do stuff, depending on what type of touch motion > > is occurring > > switch (event.getAction()) > > { > > case MotionEvent.ACTION_DOWN: > > break; > > case MotionEvent.ACTION_MOVE: > >
[android-beginners] Re: GUI test tool/framework for Android?
I am running my app on the android emulator. I am looking for a tool through which I can programatically perform (simulate) user actions on the app's GUI. A tool like WinRunner or QTE (may be not that advanced) which can interact with the GUI. Actually I need this to develop test automation for my app. On Jul 7, 1:25 pm, Gabriel Branch wrote: > If you are using eclipse to dev then you know the emulator is all part of > what you are looking for. > If you are not using eclipse then you should probably start using it. > > Go tohttp://eclipsesource.com/en/yoxos/yoxos-ondemand/and roll your own > eclipse install with all the android, svn, jUnit stuff or whatever you like > and you should be good to go. > > g > > > > On Mon, Jul 6, 2009 at 6:37 PM, Yasser wrote: > > > I need to interact with my Android application through its GUI in > > order to test it. > > > Is there any tool/framework available which can be used to perform > > various user actions on the UI elements/controls like a button click, > > read/write some text into a textbox etc.? > > > There is an "Android Instrumentation Framework" (part of SDK) but > > that's more for API or Unit testing not for functional testing. > > > Thanks > > Yasser- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Adding a view to a viewgroup
Also, you should not call this.layout(0, 0, width, height) from onMeasure(), it will be done for you. On Tue, Jul 7, 2009 at 3:33 PM, Carl wrote: > Excellent, thanks. > > On 7 July, 17:17, Jack Ha wrote: >> Your Court.onDraw() function will not get called by default for >> efficiency. You need to call setWillNotDraw(false) to enable it. >> >> -- >> Jack Ha >> Open Source Development Center >> ・T・ ・ ・Mobile・ stick together >> >> The views, opinions and statements in this email are those of >> the author solely in their individual capacity, and do not >> necessarily represent those of T-Mobile USA, Inc. >> >> On Jul 7, 5:30 am, Carl wrote: >> >> >> >> > I'm trying to do some simple UI stuff in a game (Basketball). >> >> > I've created my own Court class (which extends ViewGroup) and I want >> > to add a Ball (extends View) to the court. >> >> > Unfortunately my ball doesn't show up on the court, and in fact the >> > court doesn't draw either. >> >> > What have I done wrong? >> >> > package test.com; >> >> > import android.app.Activity; >> > import android.os.Bundle; >> > import android.view.ViewGroup.LayoutParams; >> > import android.widget.FrameLayout; >> > import android.widget.LinearLayout; >> >> > public class test extends Activity >> > { >> > /** Constants */ >> > final int FPAR = LinearLayout.LayoutParams.FILL_PARENT; >> >> > private FrameLayout main; >> >> > /** Called when the activity is first created. */ >> > @Override >> > public void onCreate(Bundle savedInstanceState) >> > { >> > super.onCreate(savedInstanceState); >> > this.addContentView(new Court(this), new >> > LayoutParams(FPAR, FPAR)); >> > } >> >> > } >> >> > package test.com; >> >> > import android.content.Context; >> > import android.graphics.Canvas; >> > import android.graphics.Color; >> > import android.graphics.Paint; >> > import android.graphics.Rect; >> > import android.view.ViewGroup; >> >> > public class Court extends ViewGroup >> > { >> > // court dimensions >> > private int height = 0; >> > private int width = 0; >> > private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); >> >> > // ball >> > Ball ball; >> >> > public Court(Context context) >> > { >> > super(context); >> > } >> >> > @Override >> > public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) >> > { >> > super.onMeasure(widthMeasureSpec, heightMeasureSpec); >> >> > // fix the sizes here >> > height = this.getMeasuredHeight(); >> > width = this.getMeasuredWidth(); >> > this.layout(0, 0, width, height); >> >> > // create a new ball >> > ball = new Ball(this, 100, 100, 20, Color.RED); >> >> > // put a ball on the court >> > this.addView(ball); >> > } >> >> > @Override >> > public void onDraw(Canvas canvas) >> > { >> > paint.setColor(Color.RED); >> > Rect rect = new Rect(this.getLeft(), this.getTop(), width, >> > height); >> > canvas.drawRect(rect, paint); >> > // tell the ball to draw itself >> > ball.draw(canvas); >> > } >> >> > @Override >> > protected void onLayout(boolean changed, int l, int t, int r, int >> > b) >> > { >> > // TODO Auto-generated method stub >> > } >> >> > } >> >> > package test.com; >> >> > import android.graphics.Canvas; >> > import android.graphics.Paint; >> > import android.view.MotionEvent; >> > import android.view.View; >> >> > public class Ball extends View >> > { >> > private int x; >> > private int y; >> > private int r; >> > private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); >> >> > public Ball(Court court, int x, int y, int r, int color) >> > { >> > super(court.getContext()); >> > mPaint.setColor(color); >> > this.x = x; >> > this.y = y; >> > this.r = r; >> > this.layout(this.x, this.y, this.x + (r * 2), this.y + (2 >> > * r)); >> > this.setOnTouchListener(this.ballTouchListener); >> > } >> >> > private OnTouchListener ballTouchListener = new OnTouchListener() >> > { >> > @Override >> > public boolean onTouch(View view, MotionEvent event) >> > { >> > // get the location of the click >> > int X = (int)event.getRawX(); >> > int Y = (int)event.getRawY(); >> >> > Ball ball = (Ball)view; >> >> > // do stuff, depending on what type of touch >> > motion is occurr
[android-beginners] Re: GUI test tool/framework for Android?
Yasser wrote: > I am running my app on the android emulator. > I am looking for a tool through which I can programatically perform > (simulate) user actions on the app's GUI. A tool like WinRunner or QTE > (may be not that advanced) which can interact with the GUI. Actually I > need this to develop test automation for my app. The instrumentation framework, which you dismissed earlier, is the answer. >>> There is an "Android Instrumentation Framework" (part of SDK) but >>> that's more for API or Unit testing not for functional testing. That is incorrect. Use android.test.ActivityInstrumentationTestCase2 and sendKeys() to simulate user input. Admittedly, this only works for keyboard/trackball events (not touch events, AFAIK), but it is better than nothing. More importantly, short of improving the instrumentation framework, you have no other real option for black-box GUI testing, due to Android's security measures. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: GUI test tool/framework for Android?
There's a TouchUtils class to simulate taps, drags, etc. On Tue, Jul 7, 2009 at 3:49 PM, Mark Murphy wrote: > > Yasser wrote: >> I am running my app on the android emulator. >> I am looking for a tool through which I can programatically perform >> (simulate) user actions on the app's GUI. A tool like WinRunner or QTE >> (may be not that advanced) which can interact with the GUI. Actually I >> need this to develop test automation for my app. > > The instrumentation framework, which you dismissed earlier, is the answer. > There is an "Android Instrumentation Framework" (part of SDK) but that's more for API or Unit testing not for functional testing. > > That is incorrect. Use android.test.ActivityInstrumentationTestCase2 and > sendKeys() to simulate user input. Admittedly, this only works for > keyboard/trackball events (not touch events, AFAIK), but it is better > than nothing. > > More importantly, short of improving the instrumentation framework, you > have no other real option for black-box GUI testing, due to Android's > security measures. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > Warescription: Three Android Books, Plus Updates, $35/Year > > > > -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: GUI test tool/framework for Android?
Romain Guy wrote: > There's a TouchUtils class to simulate taps, drags, etc. Wow, I missed that. Thanks! Out of curiosity, any ideas why the touch ones were pulled out into a separate class, as opposed to sendKeys() and kin? -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: GUI test tool/framework for Android?
It was pre-1.0, we were tired, we were busy... so I don't know :) On Tue, Jul 7, 2009 at 3:53 PM, Mark Murphy wrote: > > Romain Guy wrote: >> There's a TouchUtils class to simulate taps, drags, etc. > > Wow, I missed that. Thanks! > > Out of curiosity, any ideas why the touch ones were pulled out into a > separate class, as opposed to sendKeys() and kin? > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > Warescription: Three Android Books, Plus Updates, $35/Year > > > > -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: GUI test tool/framework for Android?
Thanks Mark. I will look more into the instrumentation framework. Questions: - Can I use this framework for UI operations without having access to the app source code? - So it means there is no way in Android for querying controls and then performing actions on them? Thanks Yasser On Jul 7, 3:49 pm, Mark Murphy wrote: > Yasser wrote: > > I am running my app on the android emulator. > > I am looking for a tool through which I can programatically perform > > (simulate) user actions on the app's GUI. A tool like WinRunner or QTE > > (may be not that advanced) which can interact with the GUI. Actually I > > need this to develop test automation for my app. > > The instrumentation framework, which you dismissed earlier, is the answer. > > >>> There is an "Android Instrumentation Framework" (part of SDK) but > >>> that's more for API or Unit testing not for functional testing. > > That is incorrect. Use android.test.ActivityInstrumentationTestCase2 and > sendKeys() to simulate user input. Admittedly, this only works for > keyboard/trackball events (not touch events, AFAIK), but it is better > than nothing. > > More importantly, short of improving the instrumentation framework, you > have no other real option for black-box GUI testing, due to Android's > security measures. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: GUI test tool/framework for Android?
Yasser wrote: > - Can I use this framework for UI operations without having access to > the app source code? Doubtful. I think you have to be signed with the same digital signature, for example, for security reasons. > - So it means there is no way in Android for querying controls and > then performing actions on them? Use the instrumentation framework. You can access all your activity's widgets, in part because you are handed the Activity object itself. Whatever you can do through the widget API, you can do in a test case. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] FreshBrain
Hello dear Android Beginners. There is a wonderful Android tutorial over at FreshBrain at https://freshbrain.org/group/building-applications-g1-mobile-phone-learning-path . Disclaimer: T-Mobile played a role in making it available, thus its wonderfulness. FreshBrain describes itself as "The Technology Exploration Platform for Teens". This sounds much more impressive than "scholastic computing website," which is why I'm in engineering and not marketing. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: problem starting emulator from command line
The reason I was having a problem (re)starting the emulator from the command line was that I did not first kill an already running emulator (by clicking on the 'x' in the top right of the emulator window). I'm able to reliably start the emulator now. On Jul 7, 8:25 am, lu XIN wrote: > hello, i am a beginner too,and I have the same anonying problem as you .my > enviroment is 32-vista and android sdk 1.5 r1. > > if you get some solution,please inform me .thank you very much . > 2009/7/6 greg > > > > > The reason the android emulator starting from within Eclipse did not > > appear to have some emulator options available is that I did not fully > > extend the window shown in response to the Eclipse "Run/Run > > Configurations/Target" menu item. Vertically extending that window > > revealed the "Additional Emulator Command Line Options" field. > > > The reason for the emulator not starting from the (64-bit Vista) > > command line is still a mystery. I'll post that problem to the > > Android Issue Tracker if I don't get any tips from the group. > > > - Greg > > > On Jul 6, 11:18 am, greg wrote: > > > Although I can reliably start the android emulator from within Eclipse > > > (version 3.4.2), I would like to use some emulator options (e.g., - > > > scale) that don't appear to be available from within Eclipse. However > > > I get a Microsoft Windows error dialog displaying "emulator.exe has > > > stopped working" whenever I try to start the emulator using the > > > command line "emulator -avd my_avd" > > > > If I disconnect the network, in addition to the "emulator.exe has > > > stopped working" dialog, the command line response is "Warning: No DNS > > > servers found". Note that the android emulator starts avd my_avd > > > reliably from within Eclipse with or without a network connection. > > > > This problem is occurring on the android 1.5 platform running on 64- > > > bit Vista. > > > > There was a reference to a seemingly similar problem athttp:// > > groups.google.com/group/android-developers/browse_thread/threa..., > > > but I didn't see any resolution to it. > > > > By the way, I think the android development environment and > > > documentation is very impressive, especially considering how new it > > > is. I did happen to notice a couple typos in the SDK's emulator > > > documentation athttp:// > > developer.android.com/guide/developing/tools/emulator.html: > > > > -- "files tht you want" > > > -- "control the its behaviors" > > > > Best regards, > > > Greg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Problem with Displaying Web Server's Response (Text) in Android
Hello, the following code uses POST method to communicate with the Web Server, and the response is displayed in the console (not parsed in a Servlet, etc). When compiled as a java application, the program works as expected returning the response as html text. My aim is to have an Android app that will communicate with servers using various protocols- and I am using this as an example in learning how that technique can be done. Therefore I would wish Android to get the response, and displaying it in 'TextView?' or somewhere. I thought this was going to be a straight-forward thing, but I have been stuck at this point for days now. Can somebody assist if possible. Thanks. The code follows package Com; import java.net.*; import java.io.*; public class FormPoster { private URL url; private QueryString query = new QueryString(); public FormPoster (URL url){ if (!url.getProtocol().toLowerCase().startsWith("http")){ throw new IllegalArgumentException("Posting only works for http URLs"); } this.url = url; } public void add(String name, String value){ query.add(name, value); } public URL getURL(){ return this.url; } public InputStream post() throws IOException { URLConnection uc = url.openConnection(); uc.setDoOutput(true); OutputStreamWriter out = new OutputStreamWriter(uc.getOutputStream (), "ASCII"); out.write(query.toString()); out.write("\r\n"); out.flush(); out.close(); return uc.getInputStream(); } public static void main(String args[]){ URL url; if (args.length > 0){ try{ url = new URL(args[0]); } catch (MalformedURLException ex){ System.err.println("Usage: java FormPoster url"); return; } } else { try{ url = new URL("http://www.cnn.com";); } catch (IOException ex){ System.err.println(ex); return; } } FormPoster poster = new FormPoster(url); poster.add("name","Charles"); poster.add("email", "ma...@yahoo.com"); try{ InputStream in = poster.post(); InputStreamReader r = new InputStreamReader(in); int c; while((c = r.read())!= -1){ System.out.print((char) c); } System.out.println(); in.close(); } catch (IOException ex){ System.err.println(ex); } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Problem with Displaying Web Server's Response (Text) in Android
Persona wrote: > Hello, the following code uses POST method to communicate with the Web > Server, and the response is displayed in the console (not parsed in a > Servlet, etc). When compiled as a java application, the program works > as expected returning the response as html text. > > My aim is to have an Android app that will communicate with servers > using various protocols- and I am using this as an example in learning > how that technique can be done. Therefore I would wish Android to get > the response, and displaying it in 'TextView?' or somewhere. I thought > this was going to be a straight-forward thing, but I have been stuck > at this point for days now. > > Can somebody assist if possible. You should try some of the tutorials on http://developer.android.com. What you have is fine for desktop Java but bears little resemblance to an Android app, any more than it bears much resemblance to a Swing or SWT app. Step #1: Get the Hello, World tutorial working http://developer.android.com/guide/tutorials/hello-world.html Step #2: Read up on AsyncTask Step #3: Create an AsyncTask that, in its doInBackground() method, does your HTTP processing, and in its onPostExecute() method, updates the TextView widget -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Moving data from Phone to PC
I am developing an Android application that collects accelerometer sensor readings. I need to somehow get this data from the phone to a desktop computer. I want to have a "Send" button that sends the data. The closest I have come is that if put the data in the image Content Provider and say it's a jpeg (it's not), then I can email that as an attachment from gmail. But that is not an acceptable thing to ask users to do. Ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Traffic filtering options
I am looking for information on traffic filtering options on the Android platform. That is, filtering Internet traffic such as HTTP, and IM. For example, on the desktop this can be achieved via a device driver such as NDIS, Windows Filtering Platform (WFP) or a Layered Service Provider (LSP). What options exist on the Android platform? Is it possible to access the network / TCP/IP stack? We would like to initially create a Web/HTTP filter then move on to a Instant Messaging filter as well. We would like to do this via filtering 3rd party applications (e.g. any application installed on a Android device) or via a custom browser & prevent usage/installation of external browsers. Thank you for any pointers / input! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Traffic filtering options
Bryan Ashby wrote: > I am looking for information on traffic filtering options on the > Android platform. That is, filtering Internet traffic such as HTTP, > and IM. For example, on the desktop this can be achieved via a device > driver such as NDIS, Windows Filtering Platform (WFP) or a Layered > Service Provider (LSP). > > What options exist on the Android platform? Is it possible to access > the network / TCP/IP stack? Only if you are creating your own firmware or are contributing modifications to the Android open source project: http://source.android.com Ordinary Java applications can use Java sockets, but only for their own application -- they cannot affect other applications' network activity (e.g., filtering). Discussion of such firmware changes are best suited for one of that project's lists: http://source.android.com/discuss > We would like to initially create a Web/HTTP filter then move on to a > Instant Messaging filter as well. We would like to do this via > filtering 3rd party applications (e.g. any application installed on a > Android device) or via a custom browser & prevent usage/installation > of external browsers. Note that "prevent usage/installation of external browsers" runs counter to Android's user-centric model. That's not to say it cannot be done, but you definitely will be swimming uphill. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android 1.5 Programming Books: http://commonsware.com/books.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Moving data from Phone to PC
garthups...@gmail.com wrote: > I am developing an Android application that collects accelerometer > sensor readings. I need to somehow get this data from the phone to a > desktop computer. I want to have a "Send" button that sends the data. > > The closest I have come is that if put the data in the image Content > Provider and say it's a jpeg (it's not), then I can email that as an > attachment from gmail. > > But that is not an acceptable thing to ask users to do. Write a Web service to collect the data, and use URLConnection or HttpClient to send the data to the Web service. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android 1.5 Programming Books: http://commonsware.com/books.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Widgets User input.
this is news to me as well~ but I then think of the fact I found that the google search widget on Home screen seems not an appwidget so maybe we can just make our widget not an appwidget if we need some user input? On Jul 6, 7:30 pm, wonglik wrote: > Argh! I thought so but I hoped that there were some walkaround :) > > Thx > w > > On Jul 5, 9:03 pm, Mark Murphy wrote: > > > > > wonglik wrote: > > > I see documentation mention only those classes are available for > > > widgets : > > > > * AnalogClock > > > * Button > > > * Chronometer > > > * ImageButton > > > * ImageView > > > * ProgressBar > > > * TextView > > > > Non of them are input ones. Is it possible to gather user input from > > > widget? > > > Only via a Button or ImageButton. If you are looking for EditText or > > something like that, the answer is no. > > > -- > > Mark Murphy (a Commons > > Guy)http://commonsware.com|http://twitter.com/commonsguy > > > _Android Programming Tutorials_ Version 1.0 In Print! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Widgets User input.
I see~ Thanks for this info! :) On Jul 8, 11:07 am, Romain Guy wrote: > The Search widget is indeed not an app widget but it's built in Home > itself. You cannot create your own non-app widgets with the standard > Home application (for security reasons.) > > > > > > On Tue, Jul 7, 2009 at 8:03 PM, nikki wrote: > > > this is news to me as well~ > > but I then think of the fact I found that the google search widget on > > Home screen seems not an appwidget > > so maybe we can just make our widget not an appwidget if we need some > > user input? > > > On Jul 6, 7:30 pm, wonglik wrote: > >> Argh! I thought so but I hoped that there were some walkaround :) > > >> Thx > >> w > > >> On Jul 5, 9:03 pm, Mark Murphy wrote: > > >> > wonglik wrote: > >> > > I see documentation mention only those classes are available for > >> > > widgets : > > >> > > * AnalogClock > >> > > * Button > >> > > * Chronometer > >> > > * ImageButton > >> > > * ImageView > >> > > * ProgressBar > >> > > * TextView > > >> > > Non of them are input ones. Is it possible to gather user input from > >> > > widget? > > >> > Only via a Button or ImageButton. If you are looking for EditText or > >> > something like that, the answer is no. > > >> > -- > >> > Mark Murphy (a Commons > >> > Guy)http://commonsware.com|http://twitter.com/commonsguy > > >> > _Android Programming Tutorials_ Version 1.0 In Print! > > -- > Romain Guy > Android framework engineer > romain...@android.com > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: GUI test tool/framework for Android?
android - pistron is tool or frame work for uint testing for user clicks and all that. On 7/8/09, Mark Murphy wrote: > > Yasser wrote: >> - Can I use this framework for UI operations without having access to >> the app source code? > > Doubtful. I think you have to be signed with the same digital signature, > for example, for security reasons. > >> - So it means there is no way in Android for querying controls and >> then performing actions on them? > > Use the instrumentation framework. You can access all your activity's > widgets, in part because you are handed the Activity object itself. > Whatever you can do through the widget API, you can do in a test case. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > Android App Developer Books: http://commonsware.com/books.html > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: android.location requestLocationUpdates only calls onLocationChanged once
no it will chanhe , yo can see by by loading kml file into ddms and press play button in bellow the kml table.yo can the locaton was moving and your location chnged method is called for testing hat put log in on location changed On 6/27/09, Andrew Gee wrote: > > Hi, > > I've just started android development and have come into a problem. > Before I explain, you can find the code I have at > http://pastebin.com/m5ca71390 > > I have created a LocationListener class, as you can see, called > MyLocationListener. I have onLocationChanged in that class which grabs > the location change and creates a Toast notification and updates two > TextViews on the interface. > > You can see the LocationManager variable where the > requestLocationUpdates method is called, referencing the > MyLocationListener object. > > ==The Problem== > Using DDMS, I change the location information. The first time I set > this I see the Toast notification and the TextView objects update, > showing the latitude and longitude. > > But subsequence changes do not get recognised by the application, as > onLocationChanged is not called at all. > > Does anyone have any good ideas? It would be very much appreciated. > > Thanks, > Andrew Gee > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Widgets User input.
The Search widget is indeed not an app widget but it's built in Home itself. You cannot create your own non-app widgets with the standard Home application (for security reasons.) On Tue, Jul 7, 2009 at 8:03 PM, nikki wrote: > > this is news to me as well~ > but I then think of the fact I found that the google search widget on > Home screen seems not an appwidget > so maybe we can just make our widget not an appwidget if we need some > user input? > > On Jul 6, 7:30 pm, wonglik wrote: >> Argh! I thought so but I hoped that there were some walkaround :) >> >> Thx >> w >> >> On Jul 5, 9:03 pm, Mark Murphy wrote: >> >> >> >> > wonglik wrote: >> > > I see documentation mention only those classes are available for >> > > widgets : >> >> > > * AnalogClock >> > > * Button >> > > * Chronometer >> > > * ImageButton >> > > * ImageView >> > > * ProgressBar >> > > * TextView >> >> > > Non of them are input ones. Is it possible to gather user input from >> > > widget? >> >> > Only via a Button or ImageButton. If you are looking for EditText or >> > something like that, the answer is no. >> >> > -- >> > Mark Murphy (a Commons >> > Guy)http://commonsware.com|http://twitter.com/commonsguy >> >> > _Android Programming Tutorials_ Version 1.0 In Print! > > > -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] How to see paid apps in Market
I cannot see any paid apps in Market (on my phone). I can only install free apps there. Is this a setting problem? Or is this other problem I can solve? Please help. Koala Yeung --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Getting Error "package file was not signed correctly" using Eclipse ADT
Are there any previous versions of MyApp on the emulator/phone ? Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 7, 10:23 pm, Carmen wrote: > Any suggestions on what to look for? > It would be great to determine a list of things to check for in this > scenario. > > This is the situation: > App works successfully on emulator and phone when launched through > Eclipse. > > Created Signed APK File created Using Eclipse ADT as described > here:http://developer.android.com/guide/publishing/app-signing.html#Export... > > It says: > To create a signed .apk, right-click the project in the Package > Explorer and select Android Tools > Export Signed Application Package. > > When I check apk file using jar signer it says the jar is verified. > jarsigner -verify -verbose -certs MyApp.apk > > When I try to install signed APK, I get the package file not signed > correctly error. > > I would love to find out I am making a dumb mistake. > > Carmen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Getting Error "package file was not signed correctly" using Eclipse ADT
Any suggestions on what to look for? It would be great to determine a list of things to check for in this scenario. This is the situation: App works successfully on emulator and phone when launched through Eclipse. Created Signed APK File created Using Eclipse ADT as described here: http://developer.android.com/guide/publishing/app-signing.html#ExportWizard It says: To create a signed .apk, right-click the project in the Package Explorer and select Android Tools > Export Signed Application Package. When I check apk file using jar signer it says the jar is verified. jarsigner -verify -verbose -certs MyApp.apk When I try to install signed APK, I get the package file not signed correctly error. I would love to find out I am making a dumb mistake. Carmen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---