Re: [android-beginners] Re: Pre-loading an SQLite database
On 8/1/2010 11:59 AM, Bret Foreman wrote: Ben, I agree with you about the crying need. From a product roadmap point of view, this is a really obvious value for many developers. But I wouldn't jump to a solution too quickly. I've been thinking about the problem for a few days now and my opinion is that initial load data should come from an online web services source, not packaged in the assets. This allows developers the option of updating their database without releasing a new version of their app. And you have to remember that users will always have a network connection when they are installing from the Marketplace, so we should take advantage of that. Now that wireless companies are moving to metered data plans, I would be very annoyed if I found that the initial install of an app required a network connection to download an undetermined amount of data. If anyone does this, they should make sure that they tell the user how much data is going to get downloaded. That way, if they are at the limit of their plan (Like the ATT $15/mo + $15 per 250MB over the initial 250), they can defer the data download until they get somewhere with WiFi... -- 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
Re: [android-beginners] is doable with android 2.1 and upper ?
On 7/12/2010 5:58 PM, jean francois pion wrote: Le 12/07/2010 23:54, Mark Murphy a écrit : On Mon, Jul 12, 2010 at 5:49 PM, jean francois pion jean.francois.p...@free.fr wrote: is it possible to make a software to read the incoming mail, read the subject and play a sound fonction of the characters string the sound must be different and customisable. Only if the developer is writing the mail client. Different devices will have different email programs, few (if any) of which have a public documented/supported API. by the way if somebody knows why all the notifications get the same sound, I think it is silly to have the same sound for mail, sms. Get a different email program, one that lets you configure the notification sound. There are a few email programs on the Market (e.g., K-9). You know, if the mail system is POP or IMAP capable, writing something that polls the message headers should be pretty straight forward. The problem is that you may not want to limit it to WiFi -- especially since unlimited data transfer is going the way of the passenger pigeon. -- 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] Re: Modifying date and time pickers
TreKing wrote: --001485f9217eb9364e0487d557cc Content-Type: text/plain; charset=ISO-8859-1 On Sat, May 29, 2010 at 8:41 PM, Brian Victor homeusen...@brianhv.orgwrote: I'd like to get started with Android development by scratching my biggest itch: the date and time pickers. What's wrong with them? Let's start with the time picker, which is the most suboptimal from my point of view. A basic, uncreative time picker should require a maximum of 6 taps, being generous, to enter a time of 12:30: clear; 1; 2; 3; 0; Done The current time picker has two entry methods. First, you can repeatedly tap or tap and hold the + and - buttons, which is tolerable for hours but laborious for minutes. Second, you can tap on the text entry field, which pops up a keyboard in alphabetical mode and does not clear the existing text. Using this method requires the following taps: tap on hours field; del; ?123; 1; 2; tap on minutes field; del; del; ?123; 3; 0; The date picker is less irritating, but I'd really like it to display a calendar as most date pickers do. * If I change those controls, will I be able to get the result onto my Droid without rooting it or waiting for a patch to be accepted upstream and pushed to my phone by my carrier? You have the entire source for Android - take the part you want (the pickers) and throw them in your own project. I don't have a project yet. I want to replace the global controls so that (e.g.) the built-in calendar program becomes usable. Right now it takes so long to set up an event that I don't even bother. * Why are those controls implemented as dialog boxes rather than intents? Because they're controls ... that users have to interact with ... how would you do that with intents? It you want to ask the user to choose a contact, you use an intent, right? If you want to ask the user to take a photo, you use an intent. I'm not sure why choosing dates or times are so much different. But then, this is why this is on beginners; I have only a high level understanding of the architecture and could be missing something obvious. -- Brian -- 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] Modifying date and time pickers
I'd like to get started with Android development by scratching my biggest itch: the date and time pickers. I'd like to make them much more efficient. Before I dive in, I have some questions: * If I change those controls, will I be able to get the result onto my Droid without rooting it or waiting for a patch to be accepted upstream and pushed to my phone by my carrier? * Is such a patch likely to be accepted? * Why are those controls implemented as dialog boxes rather than intents? -- Brian -- 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] Persisting Images - Design Query
Hi guys, I'm new enough to Android development and am still getting to grips with the framework. I'm building a simple application that will display some products where each product will have a name, description and an image. I'm using SQLite to persist the product data and have found that pretty straight forward so far. My question is around design and finding the best practice to solve my problem. My question is as follows... Where should I store the images (.png files) that are shipped with the application? Given my basic knowledge I see a couple of options here 1. Store them in the res/drawable folder and access them as standard resources e.g. R.drawable.image_name 2. Store them in the res/asset folder and access them using an InputStream. This way I could store a URI in the database for each image pointing to the file in the asset directory. These approaches are fine if the data remains static, however we want to add functionality where we will download new product data to the device from the web. When we download this data we can persist the name and description part in the database (no problems here) but I'm not sure what to do with the images. We cannot add these new images to the asset directory with the existing images as the asset directory cannot be written to at runtime. As far as I am concerned I have two options here 1. Use the MEDIA content provider to persist the image on the device internal data store and store the image URI in the database to identify the path to an image. OR 2. Create a folder on the file system and write my new image files to this folder. Then store the file path in the product database to identify an image (Not 100% sure this is possible, can someone please confirm) The problem with both these approaches is that there is an inconsistency between how my initial product images are stored and how the downloaded image updates are stored. This seems like poor design, to have your initial images in one place (res/asset) and your downloaded image updates persisted using the MEDIA content provder. I need advice on how best to approach this in terms of good clean design and best practice. I dont need specific code examples as I can figure out the implmentation myself once I've discovered what approach to take. Apologies for the long post but I've been looking at this for a few days now and have been doing quite a bit of head scratching. I'd like to start my Andorid development off using best practices so I was hoping some of the more experienced guys could assist. Thanks Brian -- 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] Re: Book for a newbie
I've been using this e-book: http://code.google.com/p/unlocking-android/ It's a little outdated at this point (mid-2009), but the code examples and walk-throughs are awesome, doesn't waste too much time talking about concepts, dives in with concrete code examples that you can play with, IMO best way to learn. If you haven't done it already, the Notepad example and walk through on http://developer.android.com is a good starting point too. On Jan 8, 4:05 pm, gony stevemcgoni...@yahoo.co.uk wrote: Having reviewed this group on the subject of best book for newbies, I have a couple questions: 1) As Begining Android 2 is not out in the UK until Feb would reading Begining Android put me at a disadvantage or is there not much difference between the books (I cant hold out until feb to get started!). 2) Is The Busy Coder's Guide to Android Development effectively the same as Begining Android 2? - If so I understand the advantages of purchasing this eBook (3 books for price of one), however I tend to prefer hardcopy. 3) Would it be fair to say that reading Begining Android could be followed by Hello Android if you want to understand the UI system better and get the experience of how to use Android to work on a mini game project? Thanks, -- 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] Updating Existing Context Menus...
I am relatively new to writing Android apps, but I have done a few small applications to get a feel for the basics. I have noticed that a few applications on my phone have made changes to the context menus of other applications and I am curious as to how to do that. For example, Evernote beta added an Evernote entry in the Gallery application Share Via context menu. How is this done?? Can it be done for all types of context menus, e.g. Contacts, Events, etc? thanks in advance! -- 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] Changing Layouts in the same Activity
I'm very new to programming the Android and I'm kind of stumbling around some tutorials. One thing I've tried doing is having a button change my layout to a different layout and then having a button on that layout change it back. I have no idea how to do this. If anybody has some ideas (especially concrete examples) I'd really appreciate it. Thanks for your time and patience! -Brian -- 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] Finding out which version of Andriod is running on a phone.
With all the different versions of Android and possible future versions, is there a way, using software, of determing which version of Andriod is on the phone? Perhaps there a class or function which can return the version number? Does anyone have any clues? This would be useful in preventing crashes with apps being run on versions of Andriod that did not support features included in one's app. Thanks in advance. -- 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] Failure [-12]
Hi All, I tried to load an app onto the Android dev 1 phone and got the following message: Failure [-12] Does anyone know what this message means? -- 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: SDK r3 on Ubuntu 9.10
No. That link doesn't help. On Oct 31, 4:35 pm, Liviu Ungureanu smartli...@gmail.com wrote: Hi! Maybe this will help :http://androidandme.com/2009/10/news/how-to-install-android-sdk-and-p... 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] Re: SDK r3 on Ubuntu 9.10
Bruce, Thanks for the tip. It looks like someone else posted a similar suggestion here: http://georgia.ubuntuforums.org/showpost.php?p=8202792postcount=4 Configuring the force http setting in androidtools.cfg seems to have done the trick for me. My laptop is currently [slowly] downloading new bits after I ran 'android update sdk'. Thanks, brian On Oct 31, 4:30 pm, erisa baw...@ucdavis.edu wrote: You are not alone. I too am trying to get 2.0 running on ubuntu 9.10 and am having the same problem. I did add the line sdkman.force.http=true to .android/androidtools.cfg, which at least got me a list of all the available components. But clicking on Install Selected produced nothing. If you find a solution please post it here and I will do the same. Bruce -- 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] SDK r3 on Ubuntu 9.10
I'm a n00b having trouble getting the Android 2.0 SDK running on Karmic Koala. I'm attempting to follow these: http://developer.android.com/sdk/index.html#quickstart directions, however when I try to add SDK components as directed from this link: http://developer.android.com/sdk/adding-components.html I can't refresh the available packages. I get a Failed to fetch URL: HTTPS ERROR whether or not I select Force https://...; in the settings tab. Suggestions? Thanks, brian --~--~-~--~~~---~--~~ 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 there a visual guide to Android components?
Hello As someone who is fairly new to Java I use online documentation and other resources very often to either to jog my memory or to learn something new. As a visual learner and frequent user of Sun's Java tutorials I find a lot of comfort in images and diagrams. Sun has a great section titled A Visual Guide to Swing Components (Java Look and Feel) which can be found here: http://java.sun.com/docs/books/tutorial/ui/features/components.html which names each Swing component and then has an example image of them in action. I found a section similar to this for the Android components in the Dev Guide but I can't seem to find it again. Does anyone know where this is or another resource which provides something similar? --~--~-~--~~~---~--~~ 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 Theme Widget wanted (For mAPPn's Home Alternative Application - aHome)
Hi there, My name is Brian and I am the Operation Manager of mAPPn, a mobile application and software provider based in Southern California. I am posting the message here looking to potentially partnerships with Android designers and developers. In short, we have had great success on the Android platform with very successful applications. Our most prominent, titled aHome, gained tremendous popularity amongst users and even caught the attention of T- Mobile USA, who then proceeded to form a partnership with our company for their successful G1 and MyTouch mobile devices. Together with T- Mobile, we have created FreshFace, a home-shell customization application that allows users to customize their background, icons, and widgets. All of our aHome themes are very popular in Android market. Check out the latest theme, Yan yan theme by http://www.cyrket.com/package/com.mappn.ahome.theme.yanyan. You also can browse the ahome themes in Market via your android phone. Developing ourselves as the leading android content provider, we are looking to partner with designers and developers who can create unique and creative themes, widgets for our aHome product. We will provide the development guide. So if you are interested and would like more information on potential opportunities in designing themes for our platform, please feel free to contact me at bri...@mappn.com. In the meantime, please visit our website at www.mappn.com to learn more about who we are. Thanks and I look forward to hearing from you. --~--~-~--~~~---~--~~ 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] Emulator crashed on X86_64 Gentoo (SDK 1.6)
I'm really excited about the Android 1.6 release and its new feature. I installed android-sdk-1.6 on my Gentoo box using the following command. # emerge android-sdk It successfully installed and I could create an AVD named TestAVD using the android command. But when I tried to run emulator with TestAVD, I got a Segmentation fault message and the emulator crashed. Does anyone run android 1.6 emulator successfully on 64bit Linux ? --~--~-~--~~~---~--~~ 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: Handling focus in ExpandableListView
Yeah - works like a charm! Thanks, Justin! Here the code snippets for others to reuse: public class ProjectList extends ExpandableListActivity implements AdapterView.OnItemSelectedListener ... @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ExpandableListView listView = getExpandableListView() ; listView.setOnItemSelectedListener(this) ; ... } ... //-- Callback when an (group) item is selected in the list public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { Log.d( Constants.LOG_TAG, onItemSelected() ); ... } //-- Callback when nothing is selected in the list public void onNothingSelected(AdapterView? arg0) { Log.d( Constants.LOG_TAG, onNothingSelected() ); } On Sep 26, 6:44 am, Justin Anderson janderson@gmail.com wrote: Try implementing the AdapterView.OnItemSelectedListener interface... Thanks, Justin -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Fri, Sep 25, 2009 at 3:57 AM, Brian heum...@me.com wrote: Hi there, I have been tinkering with the ExpandableListView and would like to tweak its behaviour a little bit. Right now you can navigate through the expandable list and when you select an entry (group) it will expand and display its children. However, I would like to expand the group automatically as soon as the group receives the focus (almost like a fisheye list). I managed to overwrite onGroupExpand(int groupPosition) to close all other entries before expanding the selected group. But I cannot find any way to install any focus listeners which gets notified when a group receives focus... Does anyone know how to do this? Regards, Brian --~--~-~--~~~---~--~~ 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] Handling focus in ExpandableListView
Hi there, I have been tinkering with the ExpandableListView and would like to tweak its behaviour a little bit. Right now you can navigate through the expandable list and when you select an entry (group) it will expand and display its children. However, I would like to expand the group automatically as soon as the group receives the focus (almost like a fisheye list). I managed to overwrite onGroupExpand(int groupPosition) to close all other entries before expanding the selected group. But I cannot find any way to install any focus listeners which gets notified when a group receives focus... Does anyone know how to do this? Regards, Brian --~--~-~--~~~---~--~~ 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: IPsec support ?
A search of the Androids kernel source returns 417 matches for IPsec On Tue, Jun 23, 2009 at 5:42 AM, Ram parushr...@yahoo.com wrote: Hi, Is there IPsec support on Android. Does Android support Application developers to make use of the IPsec ? Thank you, Ram. --~--~-~--~~~---~--~~ 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 generating final archive: Keystore was tampered with, or password was incorrect
I just upgraded from 1.1 to 1.5, and am now getting the above error when attempting to compile my apps in Eclipse. Does anyone know what I'm missing here? --~--~-~--~~~---~--~~ 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: Perform an action when switching between different operators
If by operator you mean activity, then you want to utilize the onPause/ onResume methods. On Jun 5, 1:12 am, Massimiliano Torromeo massimiliano.torro...@gmail.com wrote: Hi, I would like to develop an application that performs some actions when the current active operator changes. My goal is to apply some settings in the exact same moment of the switch, so I would like to avoid polling (also for performance/battery reasons). How could I do that? I found nothing in the documentation but maybe I wasn't looking at the right place. 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 android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Store prepopulated sqlite database in an app
The problem with just using a db created on your desktop (as opposed to pulling one off the emulator) is trusting the endianness of your pc is the same as the target device, and the db versions match. Safer to just adb pull from an emulator and store it. On May 14, 12:41 am, Mark Murphy mmur...@commonsware.com wrote: Basically, saving off a database from the emulator and blowing it up as a raw at runtime seems to work. Just create the database and store it on the emulator. Then use adb pull to pull the database from the emulator onto your desktop. Drop this .db in your project resources/ raw directory. Note that your technique should also work for SQLite databases created outside of the emulator. So long as you are running the same major release of SQLite, the file format will be the same. Hence, if you want to use some desktop tools to create the SQLite file you are baking into your APK as a raw resource, that should be fine. Also, bear in mind that you are now taking up ~1.5 times the amount of on-board flash space -- you have your full-size uncompressed copy, plus the original compressed one. There is no way to get rid of the raw resource after you are done with it. For small databases, this is not an issue, but I would not pack a large database in this way (e.g., 15MB). Finally, others have reported errors when attempting to expand large files out of the APK. I think the limit was 1MB or 2MB. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ 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] Store prepopulated sqlite database in an app
Someone in irc was trying to figure out a way to store a sqlite database in their app as a raw, then install the db in the right database location at install time, instead of having to execute a bunch of time consuming (?) insert commands. The referenced thread (http://groups.google.com/group/android-beginners/browse_thread/thread/ 21ac3596a14f4a87) seems to be closed, at least I can't reply on it, so I thought I'd throw out the code here. Apologies if this isn't an answer to what was asked. Basically, saving off a database from the emulator and blowing it up as a raw at runtime seems to work. Just create the database and store it on the emulator. Then use adb pull to pull the database from the emulator onto your desktop. Drop this .db in your project resources/ raw directory. From code, do something like this: http://pastebin.com/m50747bc5 prepopulated.db is the destination database string tableInDB is some table in the destination database, used as a test R.raw.preopulateddb is the resource ID of the source database. This is is what you copied off the emulator and stuck in your resources/raw directory This is pretty rough and tumble code. Works for me as a test; thanks for posing the problem as I'd have to get to this sooner or later, and this just pushed the issue to well before I wanted to get to it... -Brian [sorry if this is a repost, the first attempt error'd out] --~--~-~--~~~---~--~~ 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 inflating class of custom component
I'm trying to implement an custom component by extends TextView and override all counstructor, but I always get Error inflating class exception when I run my program in the emulator. What's worng with my code? Here is my custom component source code: == import android.widget.TextView; import android.content.Context; import android.util.AttributeSet; public class MaidDialogView extends TextView { public MaidDialogView (Context context) { super (context); } public MaidDialogView (Context context, AttributeSet attrs) { super (context, attrs); } public MaidDialogView (Context context, AttributeSet attrs, int defStyle) { super (context, attrs, defStyle); } } == And here is my layout XML: == ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent view class=org.bone.MaidDialogView android:layout_width=fill_parent android:layout_height=fill_parent android:layout_weight=4 android:text=Hello World, MaidroidGTD/ /LinearLayout == --~--~-~--~~~---~--~~ 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: Your location cannot be determined
I just did this, and it worked for me. Start emulator Start ddms Go to Emulator Control tab in DDMS Click the emulator-5554 in DDMS's left pane Go into Maps app on emulator Go to Menu / My Location In DDMS in the right pane, under Location Controls, ensure Manual tab is selected, and hit Send The map in the emulator should go to Google HQ in Mountain View, CA Using DDMS to send coords is how I test my gps listener for my app -- seems to work fine. On Mar 30, 4:21 pm, Benjamin benjamin.net...@gmail.com wrote: Did you have your emulator selected over in the tree-table on the left? That would be if you are using DDMS standalone -- I am not 100% certain the equivalent in the Eclipse perspective. Ok so I tried new things : I started the ddms.bat (wow it looks pretty powerful!) from the tools folder, then the emulator.exe, then I started Google Maps on the emulator, and there I started again the My Location thing, still got the error, and this message on the ddms log: 03-30 20:17:47.399: ERROR/LocationManagerService(52): isProviderEnabled got exception: 03-30 20:17:47.399: ERROR/LocationManagerService(52): java.lang.IllegalArgumentException: provider=network 03-30 20:17:47.399: ERROR/LocationManagerService(52): at com.android.server.LocationManagerService._isProviderEnabled (LocationManagerService.java:1210) 03-30 20:17:47.399: ERROR/LocationManagerService(52): at com.android.server.LocationManagerService.isProviderEnabled (LocationManagerService.java:1196) 03-30 20:17:47.399: ERROR/LocationManagerService(52): at android.location.ILocationManager$Stub.onTransact (ILocationManager.java:211) 03-30 20:17:47.399: ERROR/LocationManagerService(52): at android.os.Binder.execTransact(Binder.java:276) 03-30 20:17:47.399: ERROR/LocationManagerService(52): at dalvik.system.NativeStart.run(Native Method) I don't understand it but it seems that the provider is network, and in my app it's gps. Any new 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] Setting an Android Icon in Menu XML
How do you specify an Android icon in xml? I'm trying to make a menu with an Add button using the stock Android Add icon, like so: item android:id=@+id/menu_add android:title=Add android:icon=@drawable/ic_menu_add / // Doesn't work. android:icon=@drawable/android.R.drawable.ic_menu_add / // Also doesn't work. android:icon=@android.R.drawable/ic_menu_add / // Also doesn't work. As you can see, I'm not sure how to re-use the android Add icon in my xml (without copying it pasting it in my app, or setting it programatically I suppose) I know the icon exists, as I can do this on a dialog: .setIcon(android.R.drawable.ic_menu_add) 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 android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Setting Single Choice Dialog Checked Item
Yes, that did work, thanks much. What does that magic number represent? On Mar 28, 2:54 am, Glen Humphrey glendon.humphr...@gmail.com wrote: I also had to do one of the following to get it to work correctly. if (!lv.isItemChecked(0)) { lv.setItemChecked(0, true); } or lv.clearChoices(); lv.setItemChecked(0, true); On Mar 27, 11:17 pm, Glen Humphrey glendon.humphr...@gmail.com wrote: This seems to work for me. I have not been able to find a constant in the SDK for 16908667. I will keep looking. AlertDialog ad = (AlertDialog) d; ListView lv = (ListView) ad.findViewById(16908667); lv.setItemChecked(0, true); On Mar 27, 6:15 pm, Brian hibr...@gmail.com wrote: That returns null... Specifically: protected void onPrepareDialog(int id, Dialog d){ super.onPrepareDialog(id, d); ListView lv = (ListView) d.findViewById(android.R.id.list); // lv is null ... } The dialog is created by: new AlertDialog.Builder(...) .setIcon(...) .setTitle(...) .setSingleChoiceItems(R.array.dialog_items, 0, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { ... } }) more stuff .create(); The dialog is shown by a call to: showDialog(1); On Mar 27, 6:58 pm, Glen Humphrey glendon.humphr...@gmail.com wrote: I think you do something like this in the onPrepareDialog method. ListView listView = (ListView) dialog.findViewById(android.R.id.list); listView.setItemChecked(0, true); On Mar 27, 9:42 am, Brian hibr...@gmail.com wrote: How do you set the checked item of a single choice dialog, after the dialog has been created? Subsequent calls to showDialog() seem to remember and display the user's last checked item. I want to set the checked item myself, each time the dialog is displayed. Is there some way to set the selected item in onPrepareDialog() or elsewhere? 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 android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Setting Single Choice Dialog Checked Item
Ya, so how did you conjure up 16908667? In trying to debug this, I looked at the various android.R.id.* values to see if I could see something else that makes sense, but didn't see anything. If 16908667 is undocumented, where did you find it? By spelunking through the source? Thanks. On Mar 28, 11:27 am, Glen Humphrey glendon.humphr...@gmail.com wrote: Every view in Android has an id number assigned to it. When you put android.R.id.button1 for example that is a constant that defines the number 16908313. The number 16908667 does not seem to have a constant defined for it in the SDK. This means that this number could be possibly be changed in a future version of the SDK and would break your program. I don't know why they have decided not to include that number. You can see the defined constants at this link. http://developer.android.com/reference/android/R.id.html#button1 On Mar 28, 5:51 am, Brian hibr...@gmail.com wrote: Yes, that did work, thanks much. What does that magic number represent? On Mar 28, 2:54 am, Glen Humphrey glendon.humphr...@gmail.com wrote: I also had to do one of the following to get it to work correctly. if (!lv.isItemChecked(0)) { lv.setItemChecked(0, true); } or lv.clearChoices(); lv.setItemChecked(0, true); On Mar 27, 11:17 pm, Glen Humphrey glendon.humphr...@gmail.com wrote: This seems to work for me. I have not been able to find a constant in the SDK for 16908667. I will keep looking. AlertDialog ad = (AlertDialog) d; ListView lv = (ListView) ad.findViewById(16908667); lv.setItemChecked(0, true); On Mar 27, 6:15 pm, Brian hibr...@gmail.com wrote: That returns null... Specifically: protected void onPrepareDialog(int id, Dialog d){ super.onPrepareDialog(id, d); ListView lv = (ListView) d.findViewById(android.R.id.list); // lv is null ... } The dialog is created by: new AlertDialog.Builder(...) .setIcon(...) .setTitle(...) .setSingleChoiceItems(R.array.dialog_items, 0, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { ... } }) more stuff .create(); The dialog is shown by a call to: showDialog(1); On Mar 27, 6:58 pm, Glen Humphrey glendon.humphr...@gmail.com wrote: I think you do something like this in the onPrepareDialog method. ListView listView = (ListView) dialog.findViewById(android.R.id.list); listView.setItemChecked(0, true); On Mar 27, 9:42 am, Brian hibr...@gmail.com wrote: How do you set the checked item of a single choice dialog, after the dialog has been created? Subsequent calls to showDialog() seem to remember and display the user's last checked item. I want to set the checked item myself, each time the dialog is displayed. Is there some way to set the selected item in onPrepareDialog() or elsewhere? 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 android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Setting Single Choice Dialog Checked Item
Excellent -- I have the same value for mlistView's mId in the onPrepareDialog(). fwiw, I'm not casting to an AlertDialog, just the ListView: ListView lv = (ListView) d.findViewById(16908667); Pretty hacky, I'm not sure I want to ship this magic number, but that's a ways off. I'm new to Android dev but not device dev itself, and know things can get a bit on-the-edge. Is this a fairly common way to make an Android app -- set breakpoints, drill through structures, and use IDs you find there? A part of me is fine with that approach, but not if the magic numbers break on each device or sdk revision... On Mar 28, 1:15 pm, Glen Humphrey glendon.humphr...@gmail.com wrote: I set a breakpoint in onPrepareDialog and looked at the dialog object. It contained a field called mAlert which contained a listview called mListVIew and that listview had a field called mId which had a value of 16908667. I then tried using that value in the findViewById method. It didn't work though until I cast the dialog as an AlertDialog. On Mar 28, 9:53 am, Brian hibr...@gmail.com wrote: Ya, so how did you conjure up 16908667? In trying to debug this, I looked at the various android.R.id.* values to see if I could see something else that makes sense, but didn't see anything. If 16908667 is undocumented, where did you find it? By spelunking through the source? Thanks. On Mar 28, 11:27 am, Glen Humphrey glendon.humphr...@gmail.com wrote: Every view in Android has an id number assigned to it. When you put android.R.id.button1 for example that is a constant that defines the number 16908313. The number 16908667 does not seem to have a constant defined for it in the SDK. This means that this number could be possibly be changed in a future version of the SDK and would break your program. I don't know why they have decided not to include that number. You can see the defined constants at this link. http://developer.android.com/reference/android/R.id.html#button1 On Mar 28, 5:51 am, Brian hibr...@gmail.com wrote: Yes, that did work, thanks much. What does that magic number represent? On Mar 28, 2:54 am, Glen Humphrey glendon.humphr...@gmail.com wrote: I also had to do one of the following to get it to work correctly. if (!lv.isItemChecked(0)) { lv.setItemChecked(0, true); } or lv.clearChoices(); lv.setItemChecked(0, true); On Mar 27, 11:17 pm, Glen Humphrey glendon.humphr...@gmail.com wrote: This seems to work for me. I have not been able to find a constant in the SDK for 16908667. I will keep looking. AlertDialog ad = (AlertDialog) d; ListView lv = (ListView) ad.findViewById(16908667); lv.setItemChecked(0, true); On Mar 27, 6:15 pm, Brian hibr...@gmail.com wrote: That returns null... Specifically: protected void onPrepareDialog(int id, Dialog d){ super.onPrepareDialog(id, d); ListView lv = (ListView) d.findViewById(android.R.id.list); // lv is null ... } The dialog is created by: new AlertDialog.Builder(...) .setIcon(...) .setTitle(...) .setSingleChoiceItems(R.array.dialog_items, 0, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { ... } }) more stuff .create(); The dialog is shown by a call to: showDialog(1); On Mar 27, 6:58 pm, Glen Humphrey glendon.humphr...@gmail.com wrote: I think you do something like this in the onPrepareDialog method. ListView listView = (ListView) dialog.findViewById(android.R.id.list); listView.setItemChecked(0, true); On Mar 27, 9:42 am, Brian hibr...@gmail.com wrote: How do you set the checked item of a single choice dialog, after the dialog has been created? Subsequent calls to showDialog() seem to remember and display the user's last checked item. I want to set the checked item myself, each time the dialog is displayed. Is there some way to set the selected item in onPrepareDialog() or elsewhere? 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 android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Setting Single Choice Dialog Checked Item
Ok, selecting through the radiogroup works. I was expecting a setChecked method, and just missed checked. Final version of onPrepareDialog(): RadioGroup rg = (RadioGroup) dialog.findViewById (R.id.savecancelgroup); rg.check(R.id.save); Thanks for the help. P.S. Using 16908667 was more fun... On Mar 28, 3:57 pm, Mark Murphy mmur...@commonsware.com wrote: Brian wrote: I'm setting an individual RadioButton. Is that the right way to select? That should work. There's a corresponding method on RadioGroup. I have no idea if inflating from xml is the best way to instantiate a view, it's just what popped in mind. It's perfectly fine. You'll do this sort of thing in elaborate ListViews all the time, to create the rows the way you want 'em. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ 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: startService works, but bindService fails?
Actually what worked was to move the code to the TabActivity class, instead of one of the tabs the tabHost brings forward. For some reason, binding to the service on the tab activity doesn't work, but binding it on the TabActivity class does. On Mar 26, 11:26 am, e2865c e28...@gmail.com wrote: Are you implementing the onServiceConnected and onServiceDisconnected methods correctly? typically the Service connection is implemented as below: private MyService serviceBinder; private ServiceConnection mConnection = new ServiceConnection(){ public void onServiceConnected(ComponentName className, IBinder service ){ serviceBinder = ( (MyService.MyBinder) service).getService( ); } public void onServiceDisconnected(ComponentName className){ serviceBinder = null; } } Also try Intent bindIntent= newMe.this, MyService.class); bindService(bindIntent, mConnection, Context.BIND_AUTO_CREATE); instead of bindService(new Intent(Me.this, MyService.class), mConn, Context.BIND_AUTO_CREATE); --~--~-~--~~~---~--~~ 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] Setting Single Choice Dialog Checked Item
How do you set the checked item of a single choice dialog, after the dialog has been created? Subsequent calls to showDialog() seem to remember and display the user's last checked item. I want to set the checked item myself, each time the dialog is displayed. Is there some way to set the selected item in onPrepareDialog() or elsewhere? 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 android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] startService works, but bindService fails?
What am I missing? I've been working through the Local Service Binding API sample for my own local service, but only partial luck. startService works, but bindService doesn't. Is there some manifest flag I need to set? Some idl I need to create? This works: startService(new Intent(Me.this, MyService.class)); -- the service starts This does't work: ServiceConnection mConn = new ServiceConnection() { ...} bindService(new Intent(Me.this, MyService.class), mConn, Context.BIND_AUTO_CREATE); LogCat says: Binding with unknown activity: android.os.binderpr...@43535e18 Setting the flag to 0 in the bindService also does not work (even if the service successfully started with a call to startService), the same LogCat message is displayed. The bindService call fails if called either before or after startService (I have two buttons, one calls startService, the other calls bindService). The MyService class is nearly identical to the LocalService sample class, only changes are the class names for my project. Thanks for any suggestions. --~--~-~--~~~---~--~~ 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 cancel a notification?
I am writing a content provider and would notify some events on the status bar. I want to remove the notification after a period of time without user's notice. Any idea? Besides, should I always have to set a PendingIntent for the notification? Could I use a null intent without doing anything but leave? 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 android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Compiling Error: package does not exist
Hi, I want to have a notification on the status bar drop down. Clicking on it will launch another activity(com.android.camera.Camera). I got the following error while compiling the code: package com.android.camera does not exist contentIntent.setClass(context, com.android.camera.Camera.class); ^ Anyone knows why? 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 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 get a Content Resolver in static methods?
Hi, I want to access android.provider.Settings so I need a content resolver. Could anyone show me how to get a content resolver in frameworks/base/ core/java/android/os/Environment.java. 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 android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Testing canned apps
I've been looking over Instrumentation, and I don't think this is possible, but just in case I missed something, I thought I'd appeal to the wisdom of this group. Can I test (send key/touch events for instance) to an application already on the phone - say, the Calculator? From what I read, signatures/security prevent me from doing this Thanks in advance for any pointers! -=b=- --~--~-~--~~~---~--~~ 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: Canada... anyone got a story?
On Sat, Dec 27, 2008 at 1:12 PM, David Duong ddu...@goldenmunky.org wrote: JeanNiBee wrote: I've scoured this group and the net but haven't seen anything other than getting a Rogers account, signing up for the iPhone data plan, unlocking my Android and slapping the sim from my Rogers iPhone account / phone into the Android and hoping to get G1 service. Two questions: 1. Is this still the only way to do this? 2. Are there ANY plans for someone to bring the Android to us in the Great White North? You can actually by an unlocked Tmobile Android G1 phone from the US but the shipping is just way too much. I myself is living in Ontario Canada and I'm just waiting for my friend to buy it in the states. Other than that, you can wait till the first quarter in 2009 and _maybe_ there will be a release in Canada (I really hope so). I'm currently up in Vancouver on vacation from California with my unlocked G1. I took it down to the local mall to see if I can get a pre-pay plan that does data, and I was basically told that I'd have to sign up for a contract plan on Rogers, so it sounds like your scenario above applies. One of the employees at the store volunteered his SIM card to see if the phone's data capabilities could be tested, but it didn't work. I'm guessing I would need to enter in the Rogers APN information into the phone before data will start working. For what it's worth, T-Mo's data roaming is not working here either, the only way I'm getting data service at the moment is WiFi. Enjoy, Brian --~--~-~--~~~---~--~~ 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: emulator: ERROR: you must provide the name of a virtual machine to start the emulator.
I have it work like this (with building SDK): $ [Path to Android]/out/host/linux-x86/bin/emulator -system [Path to Android]/out/target/product/generic -kernel [Path to Android]/prebuilt/ android-arm/kernel/kernel-qemu -data [Path to Android]/out/target/ product/generic/userdata-qemu.img You should make a copy of the original userdata.img to userdata- qemu.img pointed by the -data argument. On 12月23日, 上午11時39分, malmeida malme...@gmail.com wrote: I 'solved' the problem with the following: 1. cd root dir; make sdk If you get an error about javadoc versions, have a look at the following thread: http://groups.google.com/group/android-framework/browse_thread/thread... 2. unzip the sdk zip 3. cd tools dir; ./android --list target This will list the available 'targets'. There seems to be a single 'target', which has id 1. 4. ./android --create --target 1 --name myconfig This will create a vm named 'myconfig' that corresponds to target 1. This vm name can be used to start the emulator: 5. ./emulator -vm myconfig Does anyone know if this will be the only possible way to run the emulator from now on? Will we ever be able to run the emulator straight from the output of make without having to generate the full sdk? Marcelo On Dec 22, 8:09 pm, malmeida malme...@gmail.com wrote: I tried that and the problem remains. On Dec 22, 4:06 pm, Disconnect dc.disconn...@gmail.com wrote: Run: . ./build/envsetup.sh emulator On Sun, Dec 21, 2008 at 7:50 AM, moontain chen.worksp...@gmail.com wrote: Hi, I downloaded the platform source code and completed a build. When I trying to run the emulator with following command,error occurs. $ ./out/host/darwin-x86/bin/emulator -system ./out/target/product/generic -kernel ./prebuilt/android-arm/kernel/kernel-qemu -skindir ./development/emulator/skins Below is the error message. emulator: ERROR: you must provide the name of a virtual machine to start the emulator. please see -help-vm for details. what's wrong with the command? what's the name of the virtual machine in the case? I'm using Mac OS X v 10.4.11, XCode v2.5 Regards, Moontain --~--~-~--~~~---~--~~ 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: How to let image scaled to appropriate size.
android:text=Dialer / Button android:layout_width=fill_parent android:layout_height=fill_parent android:layout_weight=1 android:text=Contacts / Button android:layout_width=fill_parent android:layout_height=fill_parent android:layout_weight=1 android:text=Applications / /LinearLayout /LinearLayout LinearLayout android:layout_width=wrap_content android:layout_height=100px android:layout_weight=1 android:orientation=vertical TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=Welcome to Android Phone. / TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=Meow... / /LinearLayout /LinearLayout [/XML] On 11月19日, 下午10時21分, Mark Dodgson [EMAIL PROTECTED] wrote: I am new to this but I think android:weight is now an invalid attribute. You should use android:gravity instead Does this help? 2008/11/19 ABTHUL RAZEETH [EMAIL PROTECTED] You can try like this. ImageView * android:layout_height=30px android:layout_width=30px * android:adjustViewBounds=true android:src=@drawable/image android:weight=1 / On Wed, Nov 19, 2008 at 6:42 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have not actually used the imageview so far myself, so I'm not sure if this will scale the image, but have you tried making the image and the button both to have a width fill parent, with a wieght of 1 each. In other words, tell the image + button to spread evenly between the available space in the linearlayout? To do this your code would change to: ..snip!... LinearLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal ImageView android:layout_width=fill_parent android:layout_height=wrap_content android:adjustViewBounds=true android:src=@drawable/image android:weight=1 / Button android:layout_width=fill_parent android:layout_height=fill_parent android:text=Hello android:weight=1 / /LinearLayout ...snip!... Please let me know if this works! On Nov 19, 4:13 am, Brian Hsu [EMAIL PROTECTED] wrote: I would like make an UI consist with a ImageView, a button and two TextView in a vertical LinearLayout. But there is a problem -- my image seems consume too much screen space. I hope the system will left enough screen space to display two TextView. I also tried apply android:adjustViewBounds to the ImageView but still has no success. android:layout_weight seems not work neither. BTW, maxHeight works but I don't want to use it because I hope the image will adjust its size when user change the orientation of the device. What I want it to look like: +-+ |+-+ +--+ | ||img | |button| | || | | | || | | | | |+-| +--+ | | | |Hello World | |Meow... | | | +-+ But what I actually get is the two TextView is totally missing. The following is my UI XML file content, where should I check or modifiy? ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical LinearLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal ImageView android:layout_width=wrap_content android:layout_height=wrap_content android:adjustViewBounds=true android:src=@drawable/image / Button android:layout_width=fill_parent android:layout_height=fill_parent android:text=Hello / /LinearLayout LinearLayout android:layout_width=wrap_content android:layout_height=wrap_content android:orientation=vertical TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=Hello World 1 / TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=Meow... / /LinearLayout
[android-beginners] Re: android file permissions on the G1
On Sun, Nov 16, 2008 at 7:14 PM, solid [EMAIL PROTECTED] wrote: I did a factory reset on my phone (clearing out the rom) this did not do anything to fix the problem. I would like to reformat my SD card. what format does the card need to be reformatted to FAT, as opposed to NTFS. My Mac says my phone is formatted with FAT16, and both my Mac and my Linux box says that the card is formatted without a MS-DOS partition table, i.e. it mounts as /dev/sdc instead of /dev/sdc1 (first partition on sdc) in Linux, and as /dev/disk3 (whole drive) on the Mac. Thanks, Brian --~--~-~--~~~---~--~~ 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] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to get a G1 whithout a suscription plan?
Please don't crosspost like this... at least wait a day or two if you don't get an answer to your first post. On Thu, Nov 13, 2008 at 11:37 AM, Juan David Trujillo C. [EMAIL PROTECTED] wrote: I don´t live in the US, but I would like to get a G1. Is it possible somehow to buy a G1 without a suscription plan, and just pay for the device? I´ve read that you have to pay a 2 year suscription, is that right? No. I paid outright for my G1, and got the IEMI unlock code about two days after I got the phone and called T-Mo and asked for it. I'm currently on a month-to-month T-Mo plan, so that smoothed a lot over. I don't know what would happen if you walked into a store (that actually had a phone) and tried to buy it outright. Worse comes to worse, you could set up a FlexPay plan and then just forget about it. After you got your GSM unlock code of course. T-Mobile FlexPay plans: http://tinyurl.com/6o98oc Thanks, Brian --~--~-~--~~~---~--~~ 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] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] question about layout.xml and View class
reposted here from the android developers group because this is a beginner question; sorry about the duplication I got a simple layout working and displaying by only editing the layout xml. Basically it was the layout below without my BoardView in there. Now I'm trying to write my own View class to handle various onFoo() events, using LunarLander as an example. Here's my simple layout and class: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent com.my.package.BoardView android:id=@+id/board android:layout_width=fill_parent android:layout_height=fill_parent/ TextView android:id=@+id/TopText android:layout_width=wrap_content android:layout_height=wrap_content android:text=play area / LinearLayout android:id=@+id/rowButtons android:orientation=horizontal android:layout_width=wrap_content android:layout_height=wrap_content Button android:id=@+id/btnPlay android:text=Play android:layout_width=wrap_content android:layout_height=wrap_content / Button android:id=@+id/btnInfo android:text=Info android:layout_width=wrap_content android:layout_height=wrap_content / Button android:id=@+id/btnSetup android:text=Setup android:layout_width=wrap_content android:layout_height=wrap_content / /LinearLayout TextView android:id=@+id/InfoText android:layout_width=wrap_content android:layout_height=wrap_content android:text=screen size: / /LinearLayout public class BoardView extends SurfaceView { public BoardView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { // TODO Auto-generated method stub super.onSizeChanged(w, h, oldw, oldh); TextView info = (TextView) findViewById(R.id.InfoText); //info.setText(width : + w + , height : + h); } } When I first ran it, it blew up with a NPE in onSizeChanged. So at least I knew it was getting there. I commented out the info.setText line and it ran fine, but the view is blank on the screen. Why are the various TextViews and buttons not visible? I couldn't find any guidelines in the docs as to how/where to place your View class in the layout.xml. --~--~-~--~~~---~--~~ 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] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---