[android-beginners] Re: Placing Layouts in a Relative Layout
Hey, I fear you are approaching Android design as if you were coding for HTML in the 90s. ;) There is no real need for a table layout here. Heres an example of a login dialog from the API Demos (samples/ApiDemos/res/layout/ alert_dialog_text_entry.xml): ?xml version=1.0 encoding=utf-8? !-- Copyright (C) 2008 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical TextView android:id=@+id/username_view android:layout_height=wrap_content android:layout_width=wrap_content android:layout_marginLeft=20dip android:layout_marginRight=20dip android:text=@string/alert_dialog_username android:gravity=left android:textAppearance=?android:attr/textAppearanceMedium / EditText android:id=@+id/username_edit android:layout_height=wrap_content android:layout_width=fill_parent android:layout_marginLeft=20dip android:layout_marginRight=20dip android:scrollHorizontally=true android:autoText=false android:capitalize=none android:gravity=fill_horizontal android:textAppearance=?android:attr/textAppearanceMedium / TextView android:id=@+id/password_view android:layout_height=wrap_content android:layout_width=wrap_content android:layout_marginLeft=20dip android:layout_marginRight=20dip android:text=@string/alert_dialog_password android:gravity=left android:textAppearance=?android:attr/textAppearanceMedium / EditText android:id=@+id/password_edit android:layout_height=wrap_content android:layout_width=fill_parent android:layout_marginLeft=20dip android:layout_marginRight=20dip android:scrollHorizontally=true android:autoText=false android:capitalize=none android:gravity=fill_horizontal android:password=true android:textAppearance=?android:attr/textAppearanceMedium / /LinearLayout Hope this helps. Paul On Sep 29, 7:56 am, Grinarn danielwisc...@googlemail.com wrote: Hi folks, i just started developing Android apps and i got a first question while designing the screen. What i want to do is do build a login screen. So i arranged my Labels and Editfields with a TableLayout in Rows. Below the fields, i want to place a Login Button and a below that, an image with a logo. So my idea was to place a TableLayout into a Relative Layout. so i can arrange my fields using a TableLayout and the Button and Image with the Relative Layout, but when i want to place my Button below the table, it appears in the topright corner. Here is my approach: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=wrap_content android:padding=10px TableLayout xmlns:android=http://schemas.android.com/apk/res/ android android:id=@+id/tableLay android:orientation=vertical android:layout_width=fill_parent android:layout_height=wrap_content TableRow android:minHeight=50px TextView android:text=@string/login_user android:paddingRight=20px android:layout_gravity=center_vertical/ EditText android:id=@+id/user android:layout_height=wrap_content android:background=@android:drawable/ editbox_background android:layout_width=200sp android:lines=1 android:maxLength=15 android:inputType=text android:layout_gravity=center_vertical android:focusable=true/ /TableRow TableRow android:minHeight=50px TextView android:text=@string/login_pass android:paddingRight=20px android:layout_gravity=center_vertical/ EditText android:id=@+id/password android:layout_height=wrap_content android:background=@android:drawable/ editbox_background android:layout_width=200sp android:lines=1 android:maxLength=15 android:inputType=textPassword android:layout_gravity=center_vertical/ /TableRow TableRow android:minHeight=50px TextView
[android-beginners] Re: How can I prevent the background from fading out when I show a dialog?
Hi, Could you possibly have the dialog as a separate activity, with the dialog theme? This gives you full control over the window background. Hope that helps. Paul On Sep 27, 10:44 am, Christian c.braumuel...@eagle-graphics.de wrote: Hi, how can I prevent the background from fading out when I show a dialog. I am showing a picture on a surface in the dialog taking from the camera. And when the background fades out the picture in the dialog on the surface is fading out too. Can I prevent the background from fading out while showing a dialog? 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] Re: Development Phone
Thanks Mark, First google seems to ran out of stock for dev phone, and if I recall the site instruction does not quite explain - rooting or whatever needed, third for some of us are already buried down to bargain basement so ebay or other sites seems to be logical alternatives :) Is there any pointer for rooting technique? What does it mean? --- I know how to get going with openmoko, but for unlocked commercial phone I would love to hack a bit, so that I can build the kernel and infrastructure and flush it, so any link to any rooting technique. For the emulator, then there must be a way to tell the canvas sizes ( i.e 360x480 or something )??? -pro On Sep 17, 3:00 am, Mark Murphy mmur...@commonsware.com wrote: pro wrote: I'm also very new to Android. And I would like to have the following - 1) I want to add and / or del any apps I want to - For this just any phone would do it? Or I need an unlocked one? All existing Android devices allow you to install third party applications and remove those third party applications. 2) I would also like to craft part of OS and / or base framework - For this, Is it enough to have an unlocked phone ? I'm getting a T mobile G1 unlocked, is it fine for (2)? You can either get an actual developer phone (ADP1 or Google Ion) that allows for firmware flashing, or you can get a consumer phone and use the various rooting techniques. 3) I think the emulator should allow us to test out various form factors, since it might not be possible to buy and test all available phones out there... It does, for the form factors that are officially supported by Android. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need help for your Android OSS project?http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: Development Phone
Thank you very much. That covers my questions. -pro On Sep 17, 5:55 am, Jeffrey Blattman jeffrey.blatt...@gmail.com wrote: On 9/16/09 8:32 PM, pro wrote: I'm also very new to Android. And I would like to have the following - 1) I want to add and / or del any apps I want to - For this just any phone would do it? Or I need an unlocked one? unlocked means it is not tied to a particular provider, so that is irrelevant to the question. you can normally add / remove any apps you want on a standard android phone. i've heard that if your phone is rooted (google if you don't know what that means), then you can only add non-copy protected apps. my phone is rooted and i've never found an app that won't install, so i'm not sure if this not true anymore or if no one chooses to copy protect their apps. 2) I would also like to craft part of OS and / or base framework - For this, Is it enough to have an unlocked phone ? I'm getting a T mobile G1 unlocked, is it fine for (2)? you need a rooted phone to patch / install a new OS. yes, the G1 from t-mobile is fine. you'll need to go through the rooting process. 3) I think the emulator should allow us to test out various form factors, since it might not be possible to buy and test all available phones out there... http://www.android.encke.net/ -pro -- --~--~-~--~~~---~--~~ 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: Development Phone
I'm also very new to Android. And I would like to have the following - 1) I want to add and / or del any apps I want to - For this just any phone would do it? Or I need an unlocked one? 2) I would also like to craft part of OS and / or base framework - For this, Is it enough to have an unlocked phone ? I'm getting a T mobile G1 unlocked, is it fine for (2)? 3) I think the emulator should allow us to test out various form factors, since it might not be possible to buy and test all available phones out there... -pro --~--~-~--~~~---~--~~ 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 get the orange border with TextView ?
Hi, First you will want to make the TextView clickable and focusable. (android:clickable=true, android:focusable=true) If you want the TextView to link to an address, phone number, website, or email address you can use the AutoLink feature. (eg. android:autoLink=web; or android:autoLink=all) I am not aware of the xml file that the browser uses for links. But you can recreate this yourself. If you are looking to set custom click listeners it will involve creating images for each of the states and referencing them in a resource xml file. You then set this xml file as the background of the TextView. For example, this is the background of a standard EditText View (platforms/android-1.5/data/res/drawable/edit_text.xml): ?xml version=1.0 encoding=utf-8? !-- Copyright (C) 2007 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_window_focused=false android:state_enabled=true android:drawable=@drawable/textfield_default / item android:state_window_focused=false android:state_enabled=false android:drawable=@drawable/textfield_disabled / item android:state_pressed=true android:drawable=@drawable/ textfield_pressed / item android:state_enabled=true android:state_focused=true android:drawable=@drawable/textfield_selected / item android:state_enabled=true android:drawable=@drawable/ textfield_default / item android:state_focused=true android:drawable=@drawable/ textfield_disabled_selected / item android:drawable=@drawable/textfield_disabled / /selector If you are going to use a custom background I would suggest using this as a template and use the Draw 9-patch tool to assign stretchable regions to your drawables. (http://developer.android.com/guide/ developing/tools/draw9patch.html) Hope this helps, Paul On Sep 9, 6:59 am, Falcon24 falco...@yopmail.com wrote: Hello, I'm currently beginning in java for android and I'm asking your help. I would like make some link in my program like phone number, mail etc.. with this border when the user clic on it. Well, when I create a WebView, the clicable link appears like that :http://www.fro2.eu/Ayabame/border_android.bmp My questions are: What's the method who provide this border and can I use it with TextView and linkify ? Can we control it in xml file or just in .java file ? Thank 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] Stepping thru android base code
Hi All, I've the 1.5 sdk pkg, as well as I've the android src ( including the kernel). I can build the android src, but I'm trying to step thru some of the internal code ( i.e android.os.* or some such ). Under eclipse debugger, it says code not found, and sometime asking for giving path to source ... I know that the eclipse is working with android1.5 so it is trying to look at the sdk location, and that does not seem to have all the android framework related code!!!. Question is if I give the path to the android src ( that I've and bult), would the debugger pick it from there, if so then is there a root folder I can point to and the debugger would recursively search and bring the code for stepping thru. Or do I need to build a package and then point to that package when I build the app... thanks -pro --~--~-~--~~~---~--~~ 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: Stepping thru android base code
Actually there are nice documents/discussion on the web about how to get the sources from the android src, and packaged it to sdk folder for reference ... problem solved :) -pro On Sep 9, 11:34 am, pro proka...@gmail.com wrote: Hi All, I've the 1.5 sdk pkg, as well as I've the android src ( including the kernel). I can build the android src, but I'm trying to step thru some of the internal code ( i.e android.os.* or some such ). Under eclipse debugger, it says code not found, and sometime asking for giving path to source ... I know that the eclipse is working with android1.5 so it is trying to look at the sdk location, and that does not seem to have all the android framework related code!!!. Question is if I give the path to the android src ( that I've and bult), would the debugger pick it from there, if so then is there a root folder I can point to and the debugger would recursively search and bring the code for stepping thru. Or do I need to build a package and then point to that package when I build the app... thanks -pro --~--~-~--~~~---~--~~ 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 do I search an xml feed?
Check this out: http://www.ibm.com/developerworks/opensource/library/x-android/ On Aug 31, 11:48 pm, russell.harro...@designvisa.com russell.harro...@designvisa.com wrote: Hi all, I want to make an android app for my search engine, I would like to do the following There would be a text field at the top, and under that users would see the results. What I want is away to send data to a xml that is hosted on my web server This is what the xml url would look like when searching (not up)http://api.bonush.com/search.xml?q={search term} xml search item titleGoogle AdSense/title descriptionThis is the description from our DB/description linkhttp://www.google.com/adsense/link item search /xml Then the results would show under the search text box. We also have a keyword xml I would like to show that when they launch the application, so they can see what users are talking about. (not up)http://api.bonush.com/keywords.xml The XML is layed out like xml keywords item titleGoogle/title linkgoogle/link item keywords /xml If a user clicks on a keyword it puts it in the search box and shows that search. If someone can help with the basics that would be great, this is my first application. 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] eclipse plug-in installation problem
Hi, I'm trying to install the plug-in on eclipse for fedora 11. Here is the version -- Fedora Eclipse Platform Version: 3.4.2 Based on build id: 20090211-1700 (c) Copyright Eclipse contributors and others 2000, 2009. All rights reserved. Visit http://sources.redhat.com/eclipse I'm seeing the following problem --- Any help is much appreciated Cannot complete the request. See the details. Unsatisfied dependency: [com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621] requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.wst.xml.core/0.0.0 Unsatisfied dependency: [com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621] requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.wst.sse.core/0.0.0 Unsatisfied dependency: [com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621] requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.wst.xml.ui/0.0.0 Unsatisfied dependency: [com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621] requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.wst.sse.ui/0.0.0 Unsatisfied dependency: [com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621] requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.wst.sse.ui/0.0.0 Unsatisfied dependency: [com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621] requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.wst.xml.ui/0.0.0 Unsatisfied dependency: [com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621] requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.wst.xml.core/0.0.0 Unsatisfied dependency: [com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621] requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.wst.sse.core/0.0.0 Thanks pro --~--~-~--~~~---~--~~ 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] eclipse plug-in installation problem
Never mind, activating all the ( brute force) the sites, makes the problem go away. thanks -pro --~--~-~--~~~---~--~~ 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: Need help selecting ringtones from a Spinner
The easiest way I know how to do this involves extending PreferenceActivity to load preferences from a xml file by calling addPreferencesFromResource(R.xml.preferences); The preferences.xml entry should be something like: RingtonePreference android:key=ringtone android:title=@string/YOUR_TITLE android:summary=@string/YOUR_SUMMARY android:ringtoneType=all android:showDefault=true android:showSilent=true / Then in your activity, to access the data: Uri uri = String.valueOf (android.provider.Settings.System.DEFAULT_NOTIFICATION_URI); String ringTone = app_preferences.getString(ringtone, uri); I'm not sure how to do this outside of extending PreferenceActivity with xml - RingtonePreference. This is based on information from The Busy Coder's Guide to Android Development. Check out the source: http://commonsware.com/Android/ (under 'Facts and Resources') and navigate to 'Prefs' folder. Can also be seen here: http://androidguys.com/?p=1891 Hope this helps, Paul Burke i...@ipaulpro.com pub:iPaul Pro On Jul 2, 11:29 am, John Reese jre...@leetcode.net wrote: Hi all, I apologize if this has been covered somewhere already, but after looking through all the SDK documentation, searching google (and the Android groups), and fruitless requests on #android, I'm stuck asking for help on this list. In my application, I'm sending notifications to the user, and I would like to allow the user to select, from a settings screen/activity, the ringtone used for the notification. I know that the RingtoneManager object can return a Cursor via getCursor(), but I can't seem to figure out the appropriate method of sticking that data into the Spinner. I've tried using a SimpleCursorAdapter as best as I could figure out with the help of Spinner-related information online, but it seems that any efforts always result in my app crashing/force-closing whenever I try to load the settings activity. Can anyone point me to any tutorial, app code, or SDK documentation that might help cover this specific usage? I've seen plenty of apps on the market use something exactly like what I want (Locale, K-9, etc), but none of those apps seem to be open source, so I can't look at them. Any help would be greatly appreciated. Cheers -- John Reese LeetCode.net --~--~-~--~~~---~--~~ 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: This errors on Second Acvivity
in your sheikanswer.java - try replacing: TextView txtView = (TextView) this.findViewById(R.id.text); with TextView txtView = (TextView) this.findViewById(R.id.sheikanswer); fix issue? On Apr 19, 8:25 am, Kevin J. Brooks bear123434...@comcast.net wrote: When you click the Ask Sheik Button, the second activity give the error application has stopped unexpectedly. I have the second activity in the Manifest. Do I also need an intent for it? SheikMagic8.zip 13KViewDownload --~--~-~--~~~---~--~~ 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: Call Log changes.
This is coming standard with Android 1.5 (Cupcake) - hold tight! On Apr 20, 3:00 pm, Rob Campbell r...@rob-campbell.com wrote: The call log shows how long the call lasted and when it started. However I would much rather know the date and time rather than just the day. Is there a way to change this or can this be easily modified? --~--~-~--~~~---~--~~ 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: application stop unexpectedly
setContentView(R.id.myTextVie); should be setContentView(R.id.main); On Apr 18, 1:33 am, amita...@gmail.com amita...@gmail.com wrote: Hi all, When i write the following code and use resource then i receive an error The application has stopped unexpectedly. Please try again. My Activity class is - public class HelloAndroid extends Activity { /** Called when the activity is first created. */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.id.myTextVie); } } source of main.xml is - ?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 TextView android:id=@+id/myTextVie android:layout_width=fill_parent android:layout_height=wrap_content android:text=Hello World, HelloWorld in the main.xml / /LinearLayout Please reply the reason of this error --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---