[android-beginners] Re: Menus in SDK 0.9
Tony S. wrote: > So, I read Android Docs online, and I tried this: > > 1) Override onCreateOptionsMenu() > > @Override > public boolean onCreateOptionsMenu(Menu menu) { > super.onCreateOptionsMenu(menu); > menu.add(0, Menu.FIRST, Menu.FIRST, R.string.options_label); > MenuInflater mi = new MenuInflater(getApplication()); > mi.inflate(R.layout.options, menu); > return true; > } Off the cuff, that looks OK, except the resource for the menu should be R.menu.options, with a menu resource file in res/menu/ in your project. > 2) Create OPTIONS.XML layout (R.layout.options) with a linearlayout > containing 2 checkboxes in it. Sorry, you need to create menus here, not views, like this chunk, extracted from the ApiDemos in the 0.9 SDK: http://schemas.android.com/apk/res/android";> Check out ApiDemos/src/com/android/samples/app/MenuInflateFromXml.java for an example of menu inflation in action. The associated menus are defined in res/menu/ in the ApiDemos. > Question: Do I have to create some openOptionsDialog() to associate to > the menu? If so, HOW? Nope. Your onCreateOptionsMenu() should be called when the user presses the Menu button. In fact, the aforementioned sample makes it seem like onCreateOptionsMenu() will be called on every Menu button push; I thought the Menu from onCreateOptionsMenu() was cached. I'll have to dig into this some more sometime soonish... > In the m5 example, there was a Menu.Add() overload that included a > parameter to pass a Runnable() to the menu, but in 0.9 can't find it. I don't think that's an option anymore, perhaps in a drive to simplify the API. Besides, you wouldn't be able to inflate a reference to a Runnable very easily. -- Mark Murphy (a Commons Guy) http://commonsware.com Warescription: All titles, revisions, & ebook formats, just $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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Menus in SDK 0.9
Thanks a lot, Mark! Now, I'm going to review all this code/tips you passed and try to put it down in the example. I'll comment back here. P.S: When will be the next version of your book? (that is, including the 0.9 SDK release changes) Thanks again, Tony On Aug 25, 2:06 pm, Mark Murphy <[EMAIL PROTECTED]> wrote: > (...) > Mark Murphy (a Commons Guy)http://commonsware.com > Warescription: All titles, revisions, & ebook formats, just $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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Menus in SDK 0.9
Tony S. wrote: > P.S: When will be the next version of your book? > (that is, including the 0.9 SDK release changes) I'm hoping version 1.2 of the ebook will be available September 7th or thereabouts. As always, the update is free for subscribers. The print edition won't be revised until sometime after the 1.0 SDK ships, hardware is available, and all that good stuff. -- Mark Murphy (a Commons Guy) http://commonsware.com Warescription: All titles, revisions, & ebook formats, just $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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] send message(ex:location or other message) between 2 emulator
thank for your help. And I have a new problem that I want to send a message(ex: location) from one emulator to the other. Can I use socket or any android api ? thanks- --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] WebView loadUrl and SD card
this is my class, where is the problem? the error message is "the application [...] has stopped unexpectedly". HELP public class asd extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); try{ WebView wv = new WebView(this); wv.loadUrl("/sdcard/index.html"); setContentView(wv); } catch(Exception e){ TextView t = new TextView(this); t.setText(e.getMessage()); this.setContentView(t); } } } P.S. The index.html had been correctly inserted into sdcard. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: WebView loadUrl and SD card
Alberto wrote: > this is my class, where is the problem? > the error message is "the application [...] has stopped unexpectedly". > HELP > > public class asd extends Activity { > /** Called when the activity is first created. */ > @Override > public void onCreate(Bundle icicle) { > super.onCreate(icicle); > > try{ > WebView wv = new WebView(this); > wv.loadUrl("/sdcard/index.html"); > setContentView(wv); > } > catch(Exception e){ > TextView t = new TextView(this); > t.setText(e.getMessage()); > this.setContentView(t); > } > } > } > > P.S. The index.html had been correctly inserted into sdcard. Starting with the 0.9 SDK, you cannot load static files off the phone (or, apparently, SD cards) into WebView. The stated reason is security. You can attempt to read the file in yourself and use loadData() instead of loadUrl() to put the information into the WebView, though it appears that approach has limitations when it comes to links and image references. -- Mark Murphy (a Commons Guy) http://commonsware.com Warescription: All titles, revisions, & ebook formats, just $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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] NotepadCodeLab
Why I can't unzip file NotepadCodLab.zip from http://code.google.com/android/intro/codelab/NotepadCodeLab.zip? tks, Rodrigo Vilaça --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: NotepadCodeLab
Download this file from here: http://groups.google.com/group/android-developers/files 2008/8/25 Rodrigo Gmail <[EMAIL PROTECTED]> > > > Why I can't unzip file NotepadCodLab.zip from > http://code.google.com/android/intro/codelab/NotepadCodeLab.zip? > > > > tks, > > Rodrigo Vilaça > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Errors when trying to build an example from a guide...how can I resolve.
I am not sure if the plugin on this site is updated for the latest release...you can check that with the site owner... Another option is to try using Eclipse if you can.. 2008/8/24 sefs <[EMAIL PROTECTED]> > > OS: Ubuntu 8.04.1 > IDE: Netbeans 6.5 Beta > > Addtional info: > -- > Android SDK installed > Android plugins installed. > > Guide being followed: > --- > http://wiki.netbeans.org/IntroAndroidDevNetBeans > > When i get to the first build and run part I get this error > > *** > init: > deps-jar: > ERROR: Unknown command 'compile' > Android Asset Packaging Tool > > Usage: > aapt l[ist] [-v] [-a] file.{zip,jar,apk} > List contents of Zip-compatible archive. > > aapt d[ump] WHAT file.{apk} [asset [asset ...]] > permissions Print the permissions from the APK. > resources Print the resource table from the APK. > configurations Print the configurations in the APK. > xmltree Print the compiled xmls in the given assets. > > aapt p[ackage] [-f][-u][-m][-v][-x][-M AndroidManifest.xml] \ > [-I base-package [-I base-package ...]] \ > [-A asset-source-dir] [-P public-definitions-file] \ > [-S resource-sources] [-F apk-file] [-J R-file-dir] \ > [raw-files-dir [raw-files-dir] ...] > > Package the android resources. It will read assets and resources that > are > supplied with the -M -A -S or raw-files-dir arguments. The -J -P -F > and -R > options control which files are output. > > aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...] > Delete specified files from Zip-compatible archive. > > aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...] > Add specified files to Zip-compatible archive. > > aapt v[ersion] > Print program version. > > Modifiers: > -a print Android-specific data (resources, manifest) when listing > -c specify which configurations to include. The default is all > configurations. The value of the parameter should be a comma > separated list of configuration values. Locales should be specified > as either a language or language-region pair. Some examples: > en > port,en > port,land,en_US > If you put the special locale, zz_ZZ on the list, it will perform > pseudolocalization on the default locale, modifying all of the > strings so you can look for strings that missed the > internationalization process. For example: > port,land,zz_ZZ > -d one or more device assets to include, separated by commas > -f force overwrite of existing files > -j specify a jar or zip file containing classes to include > -m make package directories under location specified by -J > -u update existing packages (add new, replace older, remove deleted > files) > -v verbose output > -x create extending (non-application) resource IDs > -z require localization of resource attributes marked with > localization="suggested" > -A additional directory in which to find raw asset files > -F specify the apk file to output > -I add an existing package to base include set > -J specify where to output R.java resource constant definitions > -M specify full path to AndroidManifest.xml to include in zip > -P specify where to output public resource definitions > -S directory in which to find resources > -0 don't compress files we're adding > /home/pokeymon/hd2/data/programming/MyFirstAndroidApp/nbproject/build- > impl.xml:334: exec returned: 2 > BUILD FAILED (total time: 0 seconds) > *** > > > How can I resolve that. > > Thanks. > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: No repository found at https://dl-ssl.google.com/android/eclipse/
What is your Eclipse version and OS? Did you follow the steps under "Troubleshooting ADT Installation" section below: http://code.google.com/android/intro/installing.html 2008/8/24 LGG <[EMAIL PROTECTED]> > > Hi, > While trying to install the ADT plugin, I get the following error > message: > "No repository found at https://dl-ssl.google.com/android/eclipse/"; > ??? > > -LGG > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: how can i solve
http://code.google.com/android/reference/emulator.html#connecting On Aug 24, 9:23 am, hoyu <[EMAIL PROTECTED]> wrote: > thank for your help. > And I have a new problem that I want to send a message(like location) > from one emulator to the other. > Can I use socket or any android api ? > > thanks- > > On 8月23日, 上午2時05分, "Justin (Google Employee)" <[EMAIL PROTECTED]> wrote: > > > You can't use the 0.9 emulator with the M5 SDK. SDK and emulator > > version must match. > > > Cheers, > > Justin > > Android Team @ Google > > > On Aug 22, 9:03 am, hoyu <[EMAIL PROTECTED]> wrote: > > > > I use the sdk m0.9 beta(just run the emulator.exe) > > > and then I start my eclipse ,my eclipse (use m5) can call the emulator > > > m5 ,but it is hanging , > > > anyone know how to solve? > > > >thanks- 隱藏被引用文字 - > > > - 顯示被引用文字 - --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Simple View problem. can't add children to the main View?
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); RelativeLayout mainView = (RelativeLayout)findViewById(R.id.mainWindow); AbsoluteLayout analogArea = (AbsoluteLayout)findViewById(R.id.analogArea); mainView.addView(analogArea, analogArea.getLayoutParams()); } the error occurs at addView. Why can't I add a child view to the main RelativeLayout view? Should I be doing this in a different manner? also a general question. Should I add all my views to the mainWindow view and mark them as visible=false, or add them in the manner above as needed? at some point I would like to cleanly animate the subViews changing locations as they toggle their visibility. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Can't build HelloAndroid on debian edge !
Hello, I'm trying to follow the tutorial to create and build the HelloAndroid example, unfortunately I get "Error generating final archive: null HelloAndroidUnknown" in the Problems view when trying to build/run. I've tried both with eclipse- java-europa-winter-linux-gtk.tar.gz and clipse-java-ganymede-linux- gtk.tar.gz using jdk/jre: % dpkg -l |grep java6 ii sun-java6-bin6-07-4 Sun Java(TM) Runtime Environment (JRE) 6 ii sun-java6-jdk6-07-4 Sun Java(TM) Development Kit (JDK) 6 ii sun-java6-jre6-07-4 Sun Java(TM) Runtime Environment (JRE) 6 ii sun-java6-plugin 6-07-4 The Java(TM) Plug-in, Java SE 6 % .. and no gcj: % dpkg -l |grep gcj % 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] what about Hardware request of Android system ?
Android system in the future would be a software?we can install it on the mobile devices?just like install in WM mobile,blackberry,etc. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---