[android-beginners] What to use to play OTA, RTTL and RTX media formats in android
Does anybody know what can I use to play OTA, RTTL and RTX audio formats? >From the link below http://developer.android.com/guide/appendix/media-formats.html it is supported by android but it wouldn't play using Media Player. Do you know how this was done? Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android 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] What's the little clock by one of my contacts mean?
One contact always shows a little green clock by their name - this is in every app like messaging, dialler etc. What's this mean? This is on my N1. It looks like the time is either 9 oclock or quarter to 12. -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android 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] SimpleDateFormat and Android 2.0
Hi guys, i am having some problems with SimpleDateFormat under Android 2.0, the following code: formatter = new SimpleDateFormat("MMM"); Log.i(TAG,"date is "+formatter.format(new Date()).toString ().toUpperCase()); Should return a three letter abbreviation of this months name, and it does under 1.5 and 1.6, but under 2.0 it just gives me the number of the month? -- 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 starting an activity when pressing button in menu.
Hi, I've made a menu, created by xml files. When i try to start a new activity, a program, by pressing the start game button i get the error: "The program ... stopped unexpectedley". Isn't it just to specify it in the startgame.xml that the program should get the new acticity ( as in new class)? http://schemas.android.com/apk/res/android"; > If you don't understand what is wrong with this, then please generally tell me what steps should be made. Regards Carl-Magnus -- 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] Droid BT Voice Dial - Hardware/Software Limitation?
Does anyone know if the lack of voice dialing via bluetooth headset on the Droid is a limitation of the OS or a limitation of the phone hardware itself. I find this a huge issue that really needs to be resolved but if it's hardware then that makes it much more difficult. -- 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] Bluetooth Voice dialing on Droid
My company purchased a Motorola Droid for development which inevitably will be the phone I carry 24/7. I was carrying a BB Storm for the same reason and it had voice dialing through bluetooth but I was told by Verizon this was not available on the device. I see the Voice Dial widget which seems to look up contacts as expected so it doesn¹t seem that it would have been much of an effort for the OS to pull them together. Does anyone know if there is a technical limitation in the hardware or is it just a missing feature in the OS? The best feature of bluetooth is to be able to dial while driving without having to touch the phone. Hopefully I¹m just missing something... Thanks of any input. Carl -- -- 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
Re: [android-beginners] Load xml from a url instead of R?
Not an expert but my understanding is that the XML files are used for design of the UI and are built into the app when you compile it. If you did want to do this however, you would probably have to grab the XML data from the server and then parse it yourself and build the UI based on the data using Android API calls. Sounds like a lot of work but if you wrote it generically you could use it all over the place without changes. Carl On 11/5/09 10:00 PM, "Ramsey Lee Gurley" wrote: > Hi all, > > I'm wondering if it is possible to develop an app that loads its XML > layout files from a remote server at runtime? Either load them one > 'page' at a time like a browser or perhaps load them in bulk, > something like Java's WebStart? Has anyone done this/seen it done/ > have sample code? > > Thanks, > > Ramsey > -- -- 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] Widget update with Context.sendBroadcast()
Hello all, I would like to update my AppWidget only, without interfering with the other widgets in the system. I created the following code, but I am not sure it other widgets will also update, since I am using Context.sendBroadcast(). Intent myWidgetUpdate= new Intent ("android.appwidget.action.APPWIDGET_UPDATE"); myWidgetUpdate.setClassName("com.package.name", "com.package.name.mywidget"); sendBroadcast(myWidgetUpdate); In the reference it is written: sendBroadcast(Intent intent, String receiverPermission) Broadcast the given intent to all interested BroadcastReceivers... Does this means that even if I specify the exact class to send the intent to, other unrelated widgets will also be udpated? Thank you. Carl -- 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: ADT 0.9.4 not working on Mac 10.6 (at least for me)
Xav, Here is the entire log from install until 7:00AM this morning: FYI - I did change the Java order hoping that might be it. I do have this running on a beta version of Snow Leopard but I noticed it didn't have 64-bit Java on that build. Also, I verified that I can run android and create targets from the command line so it definitely seems to just be the plug-in that is not working. Carl !SESSION 2009-10-28 08:07:57.453 --- eclipse.buildId=M20090917-0800 java.version=1.6.0_15 java.vendor=Apple Inc. BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US Framework arguments: -product org.eclipse.epp.package.java.product - keyring /Users/Carl/.eclipse_keyring -showlocation Command-line arguments: -os macosx -ws cocoa -arch x86 -product org.eclipse.epp.package.java.product -keyring /Users/ Carl/.eclipse_keyring -showlocation !ENTRY org.eclipse.core.net 1 0 2009-10-28 08:08:23.920 !MESSAGE System property http.nonProxyHosts has been set to local| *.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences !SESSION 2009-10-28 08:15:18.143 --- eclipse.buildId=M20090917-0800 java.version=1.6.0_15 java.vendor=Apple Inc. BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US Framework arguments: -product org.eclipse.epp.package.java.product - keyring /Users/Carl/.eclipse_keyring -showlocation Command-line arguments: -os macosx -ws cocoa -arch x86 -product org.eclipse.epp.package.java.product -keyring /Users/ Carl/.eclipse_keyring -showlocation !ENTRY org.eclipse.core.net 1 0 2009-10-28 08:15:27.147 !MESSAGE System property http.nonProxyHosts has been set to local| *.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences !ENTRY org.eclipse.ui 4 0 2009-10-28 08:17:28.797 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.NullPointerException at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.onMinSdkVersionFieldModified (Unknown Source) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.access $27(Unknown Source) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage $12.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1079) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java: 3441) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3100) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java: 117) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent (ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1079) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java: 3441) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3100) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java: 2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java: 149) at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run (EclipseAppHandle.java:194)
[android-beginners] ADT 0.9.4 not working on Mac 10.6 (at least for me)
First, let me say I just did this last week with 0.9.3 and SDK 1.6 successfully so I do know how to do it... :) I have built a clean OSX installation and installed Eclipse 3.5, downloaded SDK R3 for Mac and installed ADT as instructed. When I click the Android icon on the toolbar it gives me the familiar message that I have not setup the location of the SDK but when I click the button it never brings up the window to set it up. So, if I try to create an Android application there is no target to select since no emulators, etc. have been created. Has anyone else seen this and is there a workaround? --~--~-~--~~~---~--~~ 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 add a dialog in a AppWidget
Hi all, I am trying to add a dialog to a widget I made, in where when you press it, it displays two options, YES and NO. If the user presses YES, it will start an Activity. I tried to use android.app.Dialog but it looks like it only works with Activities. Is there any way of achieving this? Thanks. Carl --~--~-~--~~~---~--~~ 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 create unit tests for AppWidgetProvider
Hello all, I am trying to do unit tests for a Widget that does not have any activity, only RemoteViews, etc. I tried to use android.test.AndroidTestCase but I have and issue and question: 1. When trying to instantiate a service via context.getSystemService... the test fails with the error, "java.lang.NullPointerException" 2. How to run tests on Methods inside a AppWidgetProvider? I guess it is not possible to create instances of AppWidgetProvider and use the methods inside. Also I tried to use JUnit, but since the AppWidgetProvider depends on a context, I was not able to get a context in pure JUnit (with AndroidTestCase I could use getContext()). I tried to google and look into source code in the web, but I could not find any unit tests done for AppWidgetProviders (most were on Activities). I would appreciate any information. Regards. Carl --~--~-~--~~~---~--~~ 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] Error when starting the AVD
Get an error when i'm trying to start my AVD. emulator: ERROR: no search paths found in this AVD's configuration. Weird, the AVD's config.ini file is malformed. Try re-creating it. config.ini content hw.lcd.density=240 skin.name=WVGA800 skin.path=platforms\android-1.6\skins\WVGA800 image.sysdir.1=platforms\android-1.6\images\ myAvd.ini target=android-4 path=C:\Users\StÃ¥lmannen\.android\avd\myAvd.avd Don't now whats wrong. The strange letters in the path is a swedish letter, å. Can that be a problem? Regards Calle --~--~-~--~~~---~--~~ 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: Help! I get this error message concerning the AVD
I get the same message, tried updating but there was now cange. content config.ini hw.lcd.density=240 skin.name=WVGA800 skin.path=platforms\android-1.6\skins\WVGA800 image.sysdir.1=platforms\android-1.6\images\ content myAvd.ini target=android-4 path=C:\Users\Stålmannen\.android\avd\myAvd.avd Have you figured out what was wrong with the other? On 2 Okt, 07:43, Xavier Ducrohet wrote: > This is very strange. you could try to fix the config file with > > android updateavd--name > > If that doesn't help can you send the file to me? > > xav > > > > On Wed, Sep 30, 2009 at 3:21 PM, PeterBrynte wrote: > > > When trying to run my first attempt to an android app I get thiserror > > message concerning theAVD: > > [2009-09-30 23:57:00 - Emulator]emulator:ERROR: no search paths found > > in thisAVD'sconfiguration. > > [2009-09-30 23:57:00 - Emulator]Weird, theAVD'sconfig.ini file is > > malformed. Try re-creating it. > > [2009-09-30 23:57:00 - Emulator] > > > contents of the config.ini-file are: > > skin.name=HVGA > > skin.path=platforms\android-1.5\skins\HVGA > > image.sysdir.2=platforms\android-1.5\images\ > > image.sysdir.1=add-ons\google_apis-3\images\ > > Please tell me, what is wrong ? > > > Kind regards > > > Peter Brynte > > -- > Xavier Ducrohet > Android SDK Tech Lead > Google 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] Error in the project, unable to track
Hi, I have an error somewhere in the code but i don't know were. There is just a cross on the project folder and nowhere else. And when i try to start it tells me to correct the error. The only thing that i see errors in are some wrong spellings according to eclipse. Thanks Calle --~--~-~--~~~---~--~~ 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 clean intermediary build files
Hello all, When I was building some source code there was an error with resource files. I fixed the problem, but when I try to build again the source code using the command line, the same error shows up. I presume the builder is using the same intermediary files, made in the previous build, so I would like to ask how I can either clean the module in question (without cleaning all the modules) or, where can I find and delete the intermediary files generated by a previous build. Thank you. Regards Carl --~--~-~--~~~---~--~~ 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] Question about app widgets
Hello all, I would like to ask if it is possible to put 2 widgets in the same application. In other words, having one project, with one manifest.xml file and making 2 different widgets in the the same project. In the case that it is possible, when there is an intent android.appwidget.action.APPWIDGET_UPDATE, how does the application know which widget to choose? Thank you. Regards. Carl --~--~-~--~~~---~--~~ 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 access wireless toggle functionality
Hello all, I would like to create an application that allows the user to quickly toggle wireless connections ON/OFF. I found the API for wi-fi (android.net.wifi.WifiManager) but I am not able to find any API for Bluetooth and airplane modes. Do you have any idea where I can find such APIs or how can I have access to the switching functionality? Regards carl --~--~-~--~~~---~--~~ 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() > >
[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: Is the emulator good enough for production?
Thanks everyone for your good advice. I think I'll wait until I have a 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] Is the emulator good enough for production?
I have written a game for Android and have tested it on the emulator - everything seems to be perfect. It is a simple game with few graphics and a few touch-based commands. I'd like to release it on the market (paid). I have not yet tested it on any devices though, as I am waiting for the HTC Hero to be released so I can buy a device. Should I wait for the release or is the emulator reliable enough? --~--~-~--~~~---~--~~ 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: Basic Layout
thanks. I tried that but unfortunately I then get an arithmeticException. It also seems pretty complicated to add Views to it. On Jun 24, 3:36 pm, schwiz wrote: > try using 1 linear layout with a TableLayout tag inside then TableRow > inside of that. Make sure your TableLayout has the attribute > android:stretchColumns="*" > this should do it! > > On Jun 23, 10:16 pm, ayush wrote: > > > > > its hard to figure out without looking at your XML content. my guess > > is that you are using the "fill_parent" value for the layout_width of > > your linear layouts and the ImageView. replace this by "wrap_content" > > or alternatively specify the exact width in pixels that you want each > > of the 3 linear layouts to be. you will also have to use the same > > value on the ImageView. > > > On Jun 23, 5:13 am, Carl wrote: > > > > Why has it got to be s difficult? For a week now I’ve been > > > reading and playing around with code and have still not found the > > > answer > > > > I want a simple 3 column layout, with images going from bottom to top > > > in each. > > > Whenever I put 3 LinearLayouts next to each other in the Activity, the > > > first one takes up all the space. > > > That is if I add an ImageView to it in the XML. If I don’t then all > > > none of the Layouts appear. > > > > Very frustrated and about to quit Android altogether. Please help!- 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: Basic Layout
Thanks for all your replies. I was so fed up! Here is the layout xml. I did have the wrong (fill_parent) value in layout_width. That has solved that issue, thanks. Also, the eclipse layout editor is such a great tool. It really helps to see what you are doing before you try it in the emulator, as that is such a long-winded process. The problem I have now is that the first two columns are of equal size, and the third is small - they all fit the screen size (which is great) but they are not all the same size. This is also squeezing the image in the third column. Is there a way to resize the images so they are all the same size, fitting the column? http://schemas.android.com/apk/res/ android" android:id="@+id/llPlay" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> --~--~-~--~~~---~--~~ 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] Basic Layout
Why has it got to be s difficult? For a week now I’ve been reading and playing around with code and have still not found the answer I want a simple 3 column layout, with images going from bottom to top in each. Whenever I put 3 LinearLayouts next to each other in the Activity, the first one takes up all the space. That is if I add an ImageView to it in the XML. If I don’t then all none of the Layouts appear. Very frustrated and about to quit Android altogether. Please help! --~--~-~--~~~---~--~~ 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: OpenGL View on top of Camera
Hello Julius, did you manage to make it work? The following post doubts the possibility of enabling 2 SurfaceViews: http://groups.google.com/group/android-developers/browse_thread/thread/4850fe5c314a3dc6 Could you post your code by any chance. Cheers, Carl On Apr 27, 3:41 am, Julius Spencer wrote: > Hi, > > Apologies - no sooner than I send it and I get it going. :) > > Julius. > > On 27/04/2009, at 1:32 PM, Julius Spencer wrote: > > > > > Hi, > > > I am trying to add an OpenGL View on top of a camera preview View but > > I'm getting unexpected results (I can't see the OpenGL object). > > > I'm probably missing (not understanding) something obvious. :) > > > Either View works on its own and I can add a simple Canvas to the > > preview just not the OpenGL View. > > > super.onCreate(savedInstanceState); > > > // Hide the window title. > > requestWindowFeature(Window.FEATURE_NO_TITLE); > > > // Create our Preview view and set it as the content of our activity. > > mPreview = new Preview(this); > > mGLView = new GLSurfaceView(this); > > mGLView.setRenderer(new CubeRenderer(true)); > > > setContentView(mPreview); > > > addContentView(mGLView, new LayoutParams(LayoutParams.WRAP_CONTENT, > > LayoutParams.WRAP_CONTENT)); > > > Thanks for any help / education. > > > Cheers, > > Julius. > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---