[android-beginners] Re: Default values in SharedPreferences
Bret Foreman wrote: > Ideally, the SharedPreferences infrastructure could be told to read in > the entire preferences.xml file so the SharedPreferences database is > loaded with all the initial values. But I haven't found any way to do > that. did you try http://developer.android.com/reference/android/preference/PreferenceManager.html#setDefaultValues(android.content.Context, int, boolean) ? pskink -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. 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: database
Tanay M. Kapoor wrote: > i need to add a large amount of data to an android database i have > created. Is there any tool i can use to do this instead of making an > activity to write and manually add the data. My application need only > display the data not add new thigns to the datdbase. > Please help... yes, sqlite is cross-platform db so you can populate it on any host platform the easiest is to use sqlite3 tool pskink -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. 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: Simple Animation Code
On Aug 20, 11:33 am, Kingcrowley wrote: > Weirdly if i press the home button, and then switch back to my app it > reopens and the animation is then shown as running! > > Thanks, > > David hi, start your animation when view is already visible (not in onCreate) --~--~-~--~~~---~--~~ 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: Simple Animation Code
Kingcrowley wrote: > the imgview is not set up in onCreate but later on, > hmm, so you setVisibke(View.VISIBLE) and start() your animation on some external event, right? did you try to start() your animation in post's Runnable? post(new Runnable() {...}) pskink --~--~-~--~~~---~--~~ 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: Unable to reference custom class in xml
On Sep 19, 8:13 am, MagouyaWare wrote: > However, this results in: java.lang.NoSuchMethodException: > RunningTaskGallery(Context,AttributeSet). I double-checked just to > make sure, but this constructor does indeed exist. > > Any ideas? and what about its visibility? is it public? pskink --~--~-~--~~~---~--~~ 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: Unable to reference custom class in xml
On Sep 20, 4:19 pm, Justin Anderson wrote: > It is a public non-static class. > > Thanks, > Justin > i mean ctor. is it also public? pskink --~--~-~--~~~---~--~~ 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: Unable to reference custom class in xml
On Sep 21, 7:19 am, Justin Anderson wrote: > Thanks for your reply John P. I think you are right if I want to use an > inner class and reference it in XML then it needs to be static. That much > makes sense now (not sure exactly what I was thinking at the time)... :) > > And I was wrong about the Dev Guide. It doesn't mention different ways of > referencing them when they are static or not, just whether or not they are > nested. > > However, there is still the issue that when I make my inner class static, I > still can't reference it from the XML file... I tried making it static > after the suggestion was made, and it resulted in a NoSuchMethodException. > For some reason it can't find my constructor that takes both a Context and > an AttributeSet even though it exists and is public. > > Thanks, > Justin > Justin, so if you convinced yourself that inner class has to be static, there are no obvious reasons to keep it as the inner class. just make it 'normal' class pskink --~--~-~--~~~---~--~~ 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: ImageView.VISIBLE/INVISIBLE
furthermore your code is not called in ui thread, so maybe that's why it doesn't work try using Handler/Messages pskink --~--~-~--~~~---~--~~ 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: ImageView.VISIBLE/INVISIBLE
On Sep 26, 1:20 pm, Kingcrowley wrote: > So i declare > > ImageView imgView; > ImageView imgView1; > > in onCreate: > > imgView = (ImageView)findViewById(R.id.imageView); > imgView.setBackgroundResource(R.drawable.frame_animation); > > imgView1 = (ImageView)findViewById(R.id.imageView1); > imgView1.setBackgroundResource(R.drawable.frame_animation); > > imgView.setVisibility(View.INVISIBLE); //set imgView invisible > > then later: > > class SoundTimeTask extends TimerTask { > > public void run() { > > switch (warning) { > case 0: > imgView.setVisibility(View.VISIBLE); > frameAnimation = (AnimationDrawable) > imgView.getBackground(); > frameAnimation.start(); > > break; > ... > > does anyone see anything wrong with that? imgView never appears? > > Thanks, > > David > > On Sep 25, 10:30 pm, Kingcrowley wrote: > > > > > HI, > > > my code seems similar to yours..but doesn't work..could you copy/paste > > in yours if it isn't too long? > > > Thanks a lot > > > David > > > On Sep 25, 9:01 pm, Carmen Delessio wrote: > > > > I've got a example with a TextView and EditView where I do this > > > successfully. > > > Seehttp://developer.android.com/reference/android/view/View.html#setVisi... > > > is where View.VISIBLE is defined. > > > Just noticed View.GONE. that could be helpful. > > > > Define TextView and EditText: > > > TextView adminLabel; > > > EditText admin; > > > > Assign from Layout: > > > adminLabel = (TextView)findViewById(R.id.AdminLabel); > > > admin = (EditText)findViewById(R.id.Admin); > > > > Set to invisible: > > > admin.setVisibility(View.INVISIBLE); > > > adminLabel.setVisibility(View.INVISIBLE); > > > > Set to visible: > > > admin.setVisibility(View.VISIBLE); > > > adminLabel.setVisibility(View.VISIBLE); > > > > -- > > > Carmenhttp://www.twitter.com/CarmenDelessiohttp://www.talkingandroid.comhtt... > > > > On Fri, Sep 25, 2009 at 3:49 PM, Kingcrowley > > > wrote: > > > > > I was wondering how this works, > > > > > I can set ImageViews VISIBLE or INVISIBLE in OnCreate, but i can't > > > > seem to do it anywhere else properly? > > > > using code like "imgView.setVisibility(ImageView.VISIBLE);" > > > > any pointers/advice? > > > > > Thanks, > > > > > David why are you using TimerTask? pskink --~--~-~--~~~---~--~~ 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: ImageView.VISIBLE/INVISIBLE
On Sep 26, 4:09 pm, Kingcrowley wrote: > but for smaller projects, wouldn't using handlers be a bit of > overkill? this is just for waiting for no sensor movement, or restarts > basically if there is sensor movement > > On Sep 26, 2:26 pm, skink wrote: > > > > > On Sep 26, 3:21 pm, Kingcrowley wrote: > > > > basically the program, decides whether the phone has moved, if it > > > hasn't (time> some set time) then it makes noise and shows a simple > > > xml based animation, and the decision part decided which animation/ > > > audio to play > > > > David > > > > On Sep 26, 1:15 pm, skink wrote: > > > > > On Sep 26, 1:20 pm, Kingcrowley wrote: > > > > > > So i declare > > > > > > ImageView imgView; > > > > > ImageView imgView1; > > > > > > in onCreate: > > > > > > imgView = (ImageView)findViewById(R.id.imageView); > > > > > imgView.setBackgroundResource(R.drawable.frame_animation); > > > > > > imgView1 = (ImageView)findViewById(R.id.imageView1); > > > > > imgView1.setBackgroundResource(R.drawable.frame_animation); > > > > > > imgView.setVisibility(View.INVISIBLE); //set imgView invisible > > > > > > then later: > > > > > > class SoundTimeTask extends TimerTask { > > > > > > public void run() { > > > > > > switch (warning) { > > > > > case 0: > > > > > imgView.setVisibility(View.VISIBLE); > > > > > frameAnimation = (AnimationDrawable) > > > > > imgView.getBackground(); > > > > > frameAnimation.start(); > > > > > > break; > > > > > ... > > > > > > does anyone see anything wrong with that? imgView never appears? > > > > > > Thanks, > > > > > > David > > > > > > On Sep 25, 10:30 pm, Kingcrowley wrote: > > > > > > > HI, > > > > > > > my code seems similar to yours..but doesn't work..could you > > > > > > copy/paste > > > > > > in yours if it isn't too long? > > > > > > > Thanks a lot > > > > > > > David > > > > > > > On Sep 25, 9:01 pm, Carmen Delessio > > > > > > wrote: > > > > > > > > I've got a example with a TextView and EditView where I do this > > > > > > > successfully. > > > > > > > Seehttp://developer.android.com/reference/android/view/View.html#setVisi... > > > > > > > is where View.VISIBLE is defined. > > > > > > > Just noticed View.GONE. that could be helpful. > > > > > > > > Define TextView and EditText: > > > > > > > TextView adminLabel; > > > > > > > EditText admin; > > > > > > > > Assign from Layout: > > > > > > > adminLabel = (TextView)findViewById(R.id.AdminLabel); > > > > > > > admin = (EditText)findViewById(R.id.Admin); > > > > > > > > Set to invisible: > > > > > > > admin.setVisibility(View.INVISIBLE); > > > > > > > adminLabel.setVisibility(View.INVISIBLE); > > > > > > > > Set to visible: > > > > > > > admin.setVisibility(View.VISIBLE); > > > > > > > adminLabel.setVisibility(View.VISIBLE); > > > > > > > > -- > > > > > > > Carmenhttp://www.twitter.com/CarmenDelessiohttp://www.talkingandroid.comhtt... > > > > > > > > On Fri, Sep 25, 2009 at 3:49 PM, Kingcrowley > > > > > > > wrote: > > > > > > > > > I was wondering how this works, > > > > > > > > > I can set ImageViews VISIBLE or INVISIBLE in OnCreate, but i > > > > > > > > can't > > > > > > > > seem to do it anywhere else properly? > > > > > > > > using code like "imgView.setVisibility(ImageView.VISIBLE);" > > > > > > > > any pointers/advice? > > > > > > > > > Thanks, > > > > > > > > > David > > > > > why are you using TimerTask? > > > > > pskink > > > aha, btw android's way is to use Handler & Messages > > > pskink not at all! if you create Timer/TimerTask a new Thread is created beside the scene, furthermore your code is not called in ui --~--~-~--~~~---~--~~ 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: ImageView.VISIBLE/INVISIBLE
On Sep 26, 3:21 pm, Kingcrowley wrote: > basically the program, decides whether the phone has moved, if it > hasn't (time> some set time) then it makes noise and shows a simple > xml based animation, and the decision part decided which animation/ > audio to play > > David > > On Sep 26, 1:15 pm, skink wrote: > > > > > On Sep 26, 1:20 pm, Kingcrowley wrote: > > > > So i declare > > > > ImageView imgView; > > > ImageView imgView1; > > > > in onCreate: > > > > imgView = (ImageView)findViewById(R.id.imageView); > > > imgView.setBackgroundResource(R.drawable.frame_animation); > > > > imgView1 = (ImageView)findViewById(R.id.imageView1); > > > imgView1.setBackgroundResource(R.drawable.frame_animation); > > > > imgView.setVisibility(View.INVISIBLE); //set imgView invisible > > > > then later: > > > > class SoundTimeTask extends TimerTask { > > > > public void run() { > > > > switch (warning) { > > > case 0: > > > imgView.setVisibility(View.VISIBLE); > > > frameAnimation = (AnimationDrawable) > > > imgView.getBackground(); > > > frameAnimation.start(); > > > > break; > > > ... > > > > does anyone see anything wrong with that? imgView never appears? > > > > Thanks, > > > > David > > > > On Sep 25, 10:30 pm, Kingcrowley wrote: > > > > > HI, > > > > > my code seems similar to yours..but doesn't work..could you copy/paste > > > > in yours if it isn't too long? > > > > > Thanks a lot > > > > > David > > > > > On Sep 25, 9:01 pm, Carmen Delessio wrote: > > > > > > I've got a example with a TextView and EditView where I do this > > > > > successfully. > > > > > Seehttp://developer.android.com/reference/android/view/View.html#setVisi... > > > > > is where View.VISIBLE is defined. > > > > > Just noticed View.GONE. that could be helpful. > > > > > > Define TextView and EditText: > > > > > TextView adminLabel; > > > > > EditText admin; > > > > > > Assign from Layout: > > > > > adminLabel = (TextView)findViewById(R.id.AdminLabel); > > > > > admin = (EditText)findViewById(R.id.Admin); > > > > > > Set to invisible: > > > > > admin.setVisibility(View.INVISIBLE); > > > > > adminLabel.setVisibility(View.INVISIBLE); > > > > > > Set to visible: > > > > > admin.setVisibility(View.VISIBLE); > > > > > adminLabel.setVisibility(View.VISIBLE); > > > > > > -- > > > > > Carmenhttp://www.twitter.com/CarmenDelessiohttp://www.talkingandroid.comhtt... > > > > > > On Fri, Sep 25, 2009 at 3:49 PM, Kingcrowley > > > > > wrote: > > > > > > > I was wondering how this works, > > > > > > > I can set ImageViews VISIBLE or INVISIBLE in OnCreate, but i can't > > > > > > seem to do it anywhere else properly? > > > > > > using code like "imgView.setVisibility(ImageView.VISIBLE);" > > > > > > any pointers/advice? > > > > > > > Thanks, > > > > > > > David > > > why are you using TimerTask? > > > pskink aha, btw android's way is to use Handler & Messages pskink --~--~-~--~~~---~--~~ 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: ImageView.VISIBLE/INVISIBLE
On Sep 26, 4:34 pm, Kingcrowley wrote: > i think i get what you are sayingso basically what i have won't > work because timertask can not affect UI components? so i need to use > a Handler to monitor the things i need in a separate thread? > David > no, don't create any new thread, just create new Runnable, override run () method and postDelayed( that Runnable ) --~--~-~--~~~---~--~~ 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: Unable to update TextView on a scheduled-basis
Lance Nanek wrote: > The painless threading blog post here mentions a lot of nice ways: > http://android-developers.blogspot.com/2009/05/painless-threading.html > Lance, i wouldn't load a heavy canon (read Threads) for such a light task instead i would use Handlers pskink -- 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 can I make a vew show up really, really fast?
On Jan 6, 1:52 pm, "Mark Murphy" wrote: > > I do a setContentView(R.layout.main); in my onCreate, but have a ton > > of other things to do before the onCreate > > finishes...and it take a lot of time for anything to show up on the > > display. > > Is there an easy way just to have the layout at least pop up then get > > filled so I don't have the delay? > > Delay the extra work you have in onCreate() to a later point. For example, > use Handler#postDelayed() to have that work be done after 200ms, to allow > Android to draw your layout. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > Android App Developer Books:http://commonsware.com/books.html hi, i'd use http://developer.android.com/intl/fr/reference/android/os/MessageQueue.html#addIdleHandler(android.os.MessageQueue.IdleHandler) pskink -- 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: How can I make a vew show up really, really fast?
On Jan 7, 10:26 am, Sean Hodges wrote: > The method really depends on your requirements: > > * If the amount of work isn't too great, and you just want the > activity to be drawn before the processing starts, then postDelayed() > is a sensible approach. > > * If you have a lot of processing to do, and the execution needs to be > linear (e.g. (a) must finish before (b) which must finish before (c)) > , then an ASyncTask or Runnable would allow that to happen without > interfering with the activity event loop. > > * If you have a lot of processing to do, but want to split it up into > lots of asynchronous background tasks (and execution order is less of > an issue), then using a message queue would be more manageable. > > If you're unsure which one you will need, then a postDelayed() is a > simple approach to start off with. You could extract intensive work > into background threads later on. > > imho message queue is better solution than postDelayed() since with the latter you have to pass delayms: 200 could be ok, but maybe 100 would be better, or maybe 50 or 20? it all depends on how complex your view is and how fast/busy your device is pskink -- 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: Many objects with identical Listeners
On Jan 25, 9:46 pm, Antti Karhu wrote: > If all of EditText listeners should contain identical code, you could > implement the listener interface instead of using anonymous classes. > well, anonymous class will work as well: OnClickListener listener = new OnClickListener { public void onClick(params) { // Do something } } a.setOnClickListener(listener); b.setOnClickListener(listener); c.setOnClickListener(listener); pskink -- 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: add shadow to imageview
On Jan 26, 11:57 am, manigault wrote: > How can i add shadow to given image view. I can only setShadowLayer to > TextView .. if you need it in several places i'd write custom ShadowDrawable that extends Drawable - its quite simple task pskink -- 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: Gradient Image
On Jan 29, 10:47 am, MobDev wrote: > I'd like to use Images (so this image does include a gradient but also > several other elements like pre-rendered text but also a complex mix > of vertical and radial gradients) so using only LinearGradient or > RadialGradient wont work... > in that case you can use LayerDrawable which combines several Drawables e.g. GradientDrawables pskink -- 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: Gradient Image
On Jan 29, 7:29 pm, Robert Nekic wrote: > The only other thing that comes to mind is perhaps the RelativeLayout > isn't sizing to 320x480 courtesy of padding or margins or other layout > items...which then causes the it to scale its background image a bit? > sure its not 480px tall - apart of Activity's main View there is also status bar & title bar beneath pskink -- 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: Gradient Image
On Jan 29, 9:18 pm, Robert Nekic wrote: > In that case, instead of using the image as the RelativeLayout's > background, have you tried placing it into your RelativeLayout via an > ImageView with height/width set to wrap_content and the scaleType to > centerCrop? You might lose some pixels on the edges but it should at > least display the image without altering its proportions and possibly > introducing scaling oddities. > > or better yet, set image to RelativeLayout's background and simply set android:gravity = "bottom", this will prevent scaling pskink -- 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: Gradient Image
On Feb 1, 10:23 am, MobDev wrote: > > Setting the android:layout="bottom" on the used RealtiveLayout (with > the Image as background) still will result into a hideous version of > the original Image... hmmm, maybe this will help a bit: http://android.amberfog.com/?p=247 pskink -- 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: Gradient Image
On Feb 1, 11:32 am, skink wrote: > hmmm, maybe this will help a bit: > > http://android.amberfog.com/?p=247 > > pskink or if it doesn't help, what about 'proxy deawables' ? http://www.mail-archive.com/android-develop...@googlegroups.com/msg36450.html pskink -- 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: Gradient Image
On Feb 1, 10:23 am, MobDev wrote: > Actually I have added : > > Setting the android:layout="bottom" on the used RealtiveLayout (with > the Image as background) still will result into a hideous version of > the original Image... > i was wrong: use android:gravity="bottom" in and not in layout definition: file res/drawable/proxy.xml: and then use it in your layout's android:background="@drawable/proxy" pskink -- 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: Gradient Image
MobDev wrote: > About your solution : > If I try that it will actually resize the background to a little > version of itself and place it aligned with the bottom of the screen, > anwyays it WILL get resized/scaled... > i've test it five minutes ago to make sure that setting gravity in BitmapDrawable prevents Bitmap from scaling. maybe you forgot to change layout's background from original png image to its BitmapDrawable proxy? pskink -- 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: Gradient Image
On Feb 1, 1:33 pm, MobDev wrote: > hhmmm... > Ok I just created a proxy.xml file within the res/drawable-dpi folder > using this code : > > > xmlns:android="http://schemas.android.com/apk/res/android"; > android:src="@drawable/bgimage" > android:gravity="bottom"> > > > afterwards I created (in my main.xml file) the following : > > > http://schemas.android.com/apk/res/ > android" > android:background="@drawable/proxy" > android:layout_height="fill_parent" > android:layout_width="fill_parent"> > > > So where does that BitmapDrawable come into the equation ? :D > > On 1 feb, 13:23, skink wrote: > > > > > MobDev wrote: > > > About your solution : > > > If I try that it will actually resize the background to a little > > > version of itself and place it aligned with the bottom of the screen, > > > anwyays it WILL get resized/scaled... > > > i've test it five minutes ago to make sure that setting gravity in > > BitmapDrawable prevents Bitmap from scaling. > > > maybe you forgot to change layout's background from original png image > > to its BitmapDrawable proxy? > > > pskink -- 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: Gradient Image
On Feb 1, 1:33 pm, MobDev wrote: > hhmmm... > Ok I just created a proxy.xml file within the res/drawable-dpi folder > using this code : > > > xmlns:android="http://schemas.android.com/apk/res/android"; > android:src="@drawable/bgimage" > android:gravity="bottom"> > > > afterwards I created (in my main.xml file) the following : > > > http://schemas.android.com/apk/res/ > android" > android:background="@drawable/proxy" > android:layout_height="fill_parent" > android:layout_width="fill_parent"> > > > So where does that BitmapDrawable come into the equation ? :D > it's OK, but actually i used "bottom|left" gravity what is res/drawable-dpi folder? why not just res/drawable? i was using 320x480 image pskink -- 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: cant workout why a NullPointerException occuring !! :0
On Feb 28, 5:22 am, wahib wrote: > hello experts !! > I am trying to post variables via http push to a php script and it was > working fine with functions in my main activity.java file. but when i > seperated the functions and made a seperate class to keep it organized > it gives nullpointererror .. though i am passing the variables in > similar pattern. The log is like this ... > > W/dalvikvm( 682): threadid=3: thread exiting with uncaught exception > (group=0x4001aa28) > E/AndroidRuntime( 682): Uncaught handler: thread main exiting due to > uncaught exception > E/AndroidRuntime( 682): java.lang.RuntimeException: Unable to start > activity ComponentInfo{com.example.httprequest/ > com.example.httprequest.httppostexample}: > java.lang.NullPointerException > E/AndroidRuntime( 682): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java: > 2401) > E/AndroidRuntime( 682): at > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: > 2417) > E/AndroidRuntime( 682): at android.app.ActivityThread.access > $2100(ActivityThread.java:116) > E/AndroidRuntime( 682): at android.app.ActivityThread > $H.handleMessage(ActivityThread.java:1794) > E/AndroidRuntime( 682): at > android.os.Handler.dispatchMessage(Handler.java:99) > E/AndroidRuntime( 682): at android.os.Looper.loop(Looper.java:123) > E/AndroidRuntime( 682): at > android.app.ActivityThread.main(ActivityThread.java:4203) > E/AndroidRuntime( 682): at > java.lang.reflect.Method.invokeNative(Native Method) > E/AndroidRuntime( 682): at > java.lang.reflect.Method.invoke(Method.java:521) > E/AndroidRuntime( 682): at com.android.internal.os.ZygoteInit > $MethodAndArgsCaller.run(ZygoteInit.java:791) > E/AndroidRuntime( 682): at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) > E/AndroidRuntime( 682): at dalvik.system.NativeStart.main(Native > Method) > E/AndroidRuntime( 682): Caused by: java.lang.NullPointerException > E/AndroidRuntime( 682): at > com.example.httprequest.httppostexample.onCreate(httppostexample.java: > 62) > E/AndroidRuntime( 682): at > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: > 1123) > E/AndroidRuntime( 682): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java: > 2364) > E/AndroidRuntime( 682): ... 11 more > I/Process ( 52): Sending signal. PID: 682 SIG: 3 > I/dalvikvm( 682): threadid=7: reacting to signal 3 > I/dalvikvm( 682): Wrote stack trace to '/data/anr/traces.txt' > W/ActivityManager( 52): Launch timeout has expired, giving up wake > lock! > > plz help me out ... i am a newbie but this seems to me that i am > making some coding error !! > > Regards, > wahib indeed, you are making coding error in httppostexample.java, method onCreate, line 62 pskink -- 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: cant workout why a NullPointerException occuring !! :0
On Feb 28, 5:22 am, wahib wrote: > hello experts !! > I am trying to post variables via http push to a php script and it was > working fine with functions in my main activity.java file. but when i > seperated the functions and made a seperate class to keep it organized > it gives nullpointererror .. though i am passing the variables in > similar pattern. The log is like this ... > > W/dalvikvm( 682): threadid=3: thread exiting with uncaught exception > (group=0x4001aa28) > E/AndroidRuntime( 682): Uncaught handler: thread main exiting due to > uncaught exception > E/AndroidRuntime( 682): java.lang.RuntimeException: Unable to start > activity ComponentInfo{com.example.httprequest/ > com.example.httprequest.httppostexample}: > java.lang.NullPointerException > E/AndroidRuntime( 682): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java: > 2401) > E/AndroidRuntime( 682): at > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: > 2417) > E/AndroidRuntime( 682): at android.app.ActivityThread.access > $2100(ActivityThread.java:116) > E/AndroidRuntime( 682): at android.app.ActivityThread > $H.handleMessage(ActivityThread.java:1794) > E/AndroidRuntime( 682): at > android.os.Handler.dispatchMessage(Handler.java:99) > E/AndroidRuntime( 682): at android.os.Looper.loop(Looper.java:123) > E/AndroidRuntime( 682): at > android.app.ActivityThread.main(ActivityThread.java:4203) > E/AndroidRuntime( 682): at > java.lang.reflect.Method.invokeNative(Native Method) > E/AndroidRuntime( 682): at > java.lang.reflect.Method.invoke(Method.java:521) > E/AndroidRuntime( 682): at com.android.internal.os.ZygoteInit > $MethodAndArgsCaller.run(ZygoteInit.java:791) > E/AndroidRuntime( 682): at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) > E/AndroidRuntime( 682): at dalvik.system.NativeStart.main(Native > Method) > E/AndroidRuntime( 682): Caused by: java.lang.NullPointerException > E/AndroidRuntime( 682): at > com.example.httprequest.httppostexample.onCreate(httppostexample.java: > 62) > E/AndroidRuntime( 682): at > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: > 1123) > E/AndroidRuntime( 682): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java: > 2364) > E/AndroidRuntime( 682): ... 11 more > I/Process ( 52): Sending signal. PID: 682 SIG: 3 > I/dalvikvm( 682): threadid=7: reacting to signal 3 > I/dalvikvm( 682): Wrote stack trace to '/data/anr/traces.txt' > W/ActivityManager( 52): Launch timeout has expired, giving up wake > lock! > > plz help me out ... i am a newbie but this seems to me that i am > making some coding error !! > > Regards, > wahib indeed, you are making coding error in httppostexample.java, method onCreate, line 62 pskink -- 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: easy way to embed a button in a mapview?
On Mar 13, 2:18 pm, Mark Murphy wrote: > Far from dumb -- this is a fine upstanding technique. RelativeLayout > supports Z-axis ordering just for this sort of purpose. > isn't FrameLayout better for that? you just put in one frame MapView and, on top of this, any layout you can imagine pskink -- 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: easy way to embed a button in a mapview?
On Mar 14, 7:52 pm, Mark Murphy wrote: > skink wrote: > > > On Mar 13, 2:18 pm, Mark Murphy wrote: > >> Far from dumb -- this is a fine upstanding technique. RelativeLayout > >> supports Z-axis ordering just for this sort of purpose. > > > isn't FrameLayout better for that? > > > you just put in one frame MapView and, on top of this, any layout you > > can imagine > > You can certainly use it, but you may add another level to your View > hierarchy depth. > > *All* FrameLayout can do is Z-axis ordering. RelativeLayout can do > Z-axis ordering *and* other stuff. Moreover, you probably need a > RelativeLayout to position the button where you want, short of trying to > twist gravity in LinearLayouts to meet your needs. > > Given a choice of: > > FrameLayout > -- MapView > -- *Layout (LinearLayout or RelativeLayout) > - Button > > or: > > RelativeLayout > -- MapView > -- Button > > the second is more efficient, particularly in terms of stack space and > the dreaded StackOverflowError. > > Now, you could use margins with the Button to shove it into position, > skipping the *Layout. In that case, the two would be equivalent. I'd > still take the RelativeLayout, just for maintainability, but that may be > more a matter of personal preference. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _Android Programming Tutorials_ Version 2.0 Available! yes, you are right that it adds one more level in tree hierarchy, but still for simple layouts my personal preferense is to use LinearLayouts - maybe because they give you better visualisation of how children are layed out - you dont need to analize each children anchors, at first glance of layout xml file you see everything. but as you said its ones personal preference pskink -- 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: How to know the size of a file in adb shell prompt
On Mar 17, 5:34 pm, rocky84 rocky84 wrote: > *Hello all, > > i want to extract the size of a file in adb shell using some perl utility. > > this works fine for me as below in windows but does not work in adb shell > prompt (#) > > i used this function in windows stat($filename); > > can anybody please let me know how can i get file size in #prompt? > > regds > rocky > * ls -l filename l is for long pskink -- 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: By when onActivityResult is called??
DroidBy wrote: > When onActivityResult(int, int, Intent) will be called? > > I notice this is not called when I call finish(); on the activity that > I start with startActivityForResult (Intent intent, int requestCode). > > Does it means the activity is not exit even I call finish() on it? did you call setResult(int) in your child Activity? -- 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 To unsubscribe, reply using "remove me" as the subject.
[android-beginners] virtual keyboard / input method
hi, i created yavk (yet another virtual keyboard) - http://www.filefactory.com/file/ba0a10/n/VirtualKeyboard_apk , but have no idea how to integrate it with the rest of the system... somehow by Intent/IntentFilter in AndroidManifest.xml ??? any help appreciated thanks pskink --~--~-~--~~~---~--~~ 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: What is Earliest Opportunity (and how) to learn View Width and Height?
> Is it even possible to know the view > dimensions prior to actually displaying the initial screen? > > Much thanks, i tried to call view's measure() method and then getMeasuredWidth/ Height() but sometimes got strange (8 pixels wider and taller) results --~--~-~--~~~---~--~~ 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: What is Earliest Opportunity (and how) to learn View Width and Height?
On 16 Sty, 18:09, Romain Guy wrote: > Do not call measure directly unless you understand precisely how to > use it. You *have* to wait for the first layout to query the width and > height of a View. > as measure() is public and docs dont say anything specific how to use it, so, well, how to use it? i'm asking because now i'm extending LinearLayout and have no idea how to measure itself and children, btw onLayout() getWidth/ getMeasuredWidth returns 0 --~--~-~--~~~---~--~~ 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: What is Earliest Opportunity (and how) to learn View Width and Height?
skink wrote: > i'm asking because now i'm extending LinearLayout and have no idea how > to measure itself and children, btw onLayout() getWidth/ > getMeasuredWidth returns 0 i'm sorry i forgot about most important thing: in my class (extending LinearLayout) onFinishInflate() method i set visibility of one of its child to GONE (layout has two children: one is always VISIBLE second is initially GONE). the question is: how to measure that child whose visibility is GONE? is it possible at all? --~--~-~--~~~---~--~~ 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: What is Earliest Opportunity (and how) to learn View Width and Height?
btw this is what i'm doing in onFinishInflate() before setting visibility to GONE: ViewGroup.LayoutParams params = content.getLayoutParams(); if (MeasureSpec.getMode(params.height) == MeasureSpec.UNSPECIFIED) { contentHeight = params.height; } else { content.measure(params.width, params.height); contentHeight = content.getMeasuredHeight(); } content.setVisibility(GONE); --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---