[android-developers] Re: Polite discussion of lite/trial vs pro distribution

2009-05-13 Thread Mariano Kamp
What's your app?

On Wed, May 13, 2009 at 6:53 PM, Sundog  wrote:

>
>
> > I think you can make the situation a lot better for yourself by 
> > accepting that people generally suck.
>
> Sadly, yeah.
>
> Any moment now there will be an everything-should-be-free freak here
> saying that you should write code for the sake of your art, not for
> any expectation of monetary gain. Somehow we seem to be crawling with
> these types, and guess what? They're getting the crappy free software
> they deserve.
>
> I don't have this problem, thankfully. I have comments and ratings to
> die for and no troll problems at all. I attribut this almost entirely
> to the fact the my sales are well over 90% to women. So maybe that's
> your answer, lol.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Another AbsoluteLayout deprecation question

2009-05-13 Thread Keith Wiley

Right, and unlike some of the other posters who seemed to have a
slight more agitated tone, I really tried to emphasize that I want to
get on board with respect to this particular issue.  I'm not
complaining about AbsoluteLayout's deprecation at all, I just want to
write my code correctly, and if AbsoluteLayout is not the recommended
way to place one view at an arbitrary location on top of another view,
I was just wondering what *is* the recommended way.  I was getting
confused because some places said FrameLayout and RelativeLayout were
the solution, but other places were very clear that they weren't the
best solution.  I had also seen the suggestions of rolling a layout
manager on my own...I was just...a little unsteady about that.

I'll look into making my own layout manager.  Please consider how
confusing this is for those of us not already in the know.  For
example, I would assume this consists of writing my own layout class,
something akin to AbsoluteLayout or LinearLayout, etc.  The funny
thing, which I find very confusing, is that none of those are actually
subclasses of Layout!  They subclass ViewGroup, while Layout is some
other class which doesn't seem to have any direct connection to the
existing Layouts.  Thus my impending confusion.

I'll do some research on layout managers on my own first, the pointer
in that direction was sufficient, thank you...I'm just asking that you
please realize the apparent discrepancy in terminology which I find
confusing.

Cheers!

On May 13, 11:05 pm, Romain Guy  wrote:
> Again, AbsoluteLayout was deprecated to encourage developers to use
> "real" layout managers. AbsoluteLayout just won't work with other
> screen resolutions and densities. Like Dianne said, it won't go away
> but we want you guys to think very hard before using it. It is (most
> of the time) bad practice and will only come back to haunt you in the
> future.
>
>
>
> On Wed, May 13, 2009 at 11:00 PM, Mark Murphy  wrote:
>
> >> I believe I have politely and thoroughly stated my question.  Anyone
> >> have an answer?
>
> > Everybody, even to an extent the core Android team folk on this list, is
> > contributing answers on a volunteer basis. Lots of questions get asked
> > here that do not get answered, for any number of reasons.
>
> > Also, bear in mind that you sent your question less than 24 hours ago. Not
> > everybody monitors this list continuously. If you need answers in that
> > short of a timeframe, hire a consultant.
>
> > I have watched your thread since its inception. I did not reply at first,
> > because you seemed set on having a core Android team member answer, and I
> > am not such a person. However, since your focus now seems to be on getting
> > some sort of answer from anyone, here's my take on it:
>
> >>> > I have seen a number of threads discussing the deprecation
> >>> ofAbsoluteLayout.  I'm a little fearful of reading third-party blogs
> >>> > that suggest solutions to the deprecation because in some discussion
> >>> > threads the Google employees have explicitly said the blogs contain
> >>> > misunderstandings or inaccuracies.
>
> > According to Ms. Hackborn's most recent(?) post on the topic, while
> > AbsoluteLayout is deprecated, it is not going away. Strategically, I
> > suppose that means no new code should be built that relies upon
> > AbsoluteLayout, but there is no need for a massive rush to the exits to
> > abandon AbsoluteLayout for existing code.
>
> > Personally, if I were in your shoes, I would aim to eliminate my
> > dependency on AbsoluteLayout in the next few months. Note that "eliminate
> > the dependency on AbsoluteLayout" could be simply a mental bookmark that,
> > should AbsoluteLayout ever be truly removed from the platform, that you
> > will be willing and able to maintain AbsoluteLayout yourself, based on the
> > last implementation found in the Android open source project.
>
> > But, again, Ms. Hackborn has indicated AbsoluteLayout is not going away,
> > and so you may elect to not worry about this issue in the near term.
>
> >>> > So, I need to know how to implement my app's behavior
> >>> withoutAbsoluteLayout.  I would greatly appreciate any input people
> >>> might
> >>> > have, especially the real pros, the Android dev team who, by
> >>> > deprecatingAbsoluteLayout, must have a clear picture in their heads
> >>> > of how to reorganize code to be up-to-date to achieve the same
> >>> > functionality.  Romain Guy, Diane Hackborn, I'm looking your
> >>> > direction.  :-)
>
> > I believe both of them, in related threads, indicated that the solution is
> > to create your own layout manager, rather than use AbsoluteLayout or
> > RelativeLayout or any of the other built-in ones.
>
> > Unfortunately, I am unaware of any tutorials on exactly how to do this.
> > You can probably examine the source of some of the existing layout
> > managers to see how they do what they do.
>
> > --
> > Mark Murphy (a Commons Guy)
> >http://commonsware.com
> > _The Busy Coder'

[android-developers] UI problem

2009-05-13 Thread Sukitha Udugamasooriya

Hi geniuses,

I have few buttons on the content. When I click on one button,

1-- I want to change the text of the button.
2-- Then I want to change the content view.

this is my method which executes with the onClick event.

private void markUser(int index) {

btnArray[index].setText(mark);
btnArray[index].setClickable(false);

showGameOverMenu(); // calls the setContentView();
}

Here the problem is the text change of the button is not visible.

How can I make it visible??? I'm not thorough with how the UI thread
works in android

Thanks in advance

Sukitha
(wannaB android master ;))
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Options for synchroinizing data between Android and backend database

2009-05-13 Thread Lonifasiko

Hi all,

Wanted to develop a mobile application for Android devices that stores
data locally and synchonizes (bidirectionally) local data with a
database server every 'N' minutes. That is, instead of building a web
application accesible from Android's browser that forces me to be
"always connected", I wanted to try the approach of "sometimes
connected" scenario.

I was thinking in using MySQL as server backend, but new to Android
and don't know which are the options to communicate and synchronize
data between mobile devices and servers. Is there any Android library
that makes this always hellish synchronization work easier?

What about Google Gears?

Thanks very much in advance.

--
Miguel
Blog: http://lonifasiko.blogspot.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: 1.5 api change - broken scrollbar resources

2009-05-13 Thread Peter Carpenter

Hi Romain,

That makes complete sense.  Will make appropriate changes.

Cheers,

Peter.

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Romain Guy
Sent: Thursday, 14 May 2009 4:07 PM
To: android-developers@googlegroups.com
Subject: [android-developers] Re: 1.5 api change - broken scrollbar resources


The system scrollbar does not have a track anymore. Your code should
simply account for that possibility. The framework code does attempt
to load a scrollbar track but does not crash if no resource is
present.

On Wed, May 13, 2009 at 10:36 PM, Peter Carpenter
 wrote:
>
>
> Hi all,
>
> I've just been attempting to upgrade my application to support 1.5 and
> discovered that I can no longer retrieve a resource for my scrollbar
> background.
>
> My app requires me to draw a scrollbar that I can use to control a
> custom component.
>
> Currently I was using the following code (which Jeff was kind enough to
> point me in the right direction of):
>
> TypedValue val = new TypedValue();
> if (context.getTheme().resolveAttribute(
>       android.R.attr.scrollbarThumbVertical, val, true))
> {
>    scrollThumb = getResources().getDrawable(val.resourceId);
> }
> if (context.getTheme().resolveAttribute(
>       android.R.attr.scrollbarTrackVertical, val, true))
> {
>    scrollTrack = getResources().getDrawable(val.resourceId);
> }
>
> However the 2nd getDrawable causes a ResourceNotFound exception so it
> appears the scrollbarTrackVertical has been removed??
>
> Does anyone know of any other ways to get the system scrollbar
> drawables? (or a system scrollbar by itself?)
>
> Regards,
>
> Peter.
>
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: dynamically setting drawSelectorOnTop

2009-05-13 Thread Romain Guy

Oops my bad, you were talking about *Spinner*. Spinner does NOT
support android:drawSelectorOnTop, so there's no equivalent Java API.
Setting this attribute in XML has absolutely no effect (in particular
because a Spinner does not have a selector.)

On Wed, May 13, 2009 at 7:59 PM, damnesia  wrote:
>
> Yeah, I saw it in the documentation online but when I do
> spinner.setDrawSelectorOnTop(true); I get "The method
> setDrawSelectorOnTop(boolean) is undefined for the type Spinner".
>
> I am using Android android-sdk-linux_x86-1.1_r1. Do I need to upgrade?
>
> Thank you for your time.
>
>
> On May 13, 2:59 pm, Romain Guy  wrote:
>> It's in the documentation :) Hint, look for setDrawSelectorOnTop(boolean).
>>
>> On Wed, May 13, 2009 at 2:53 PM, damnesia  wrote:
>>
>> > Is it possible to dynamically set the drawSelectorOnTop attribute on a
>> > Spinner instead of having to do it in the layout XML?
>>
>> --
>> Romain Guy
>> Android framework engineer
>> romain...@android.com
>>
>> Note: please don't send private questions to me, as I don't have time
>> to provide private support.  All such questions should be posted on
>> public forums, where I and others can see and answer them
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: DexClassLoader caould not invoke method from another application properly

2009-05-13 Thread Ask

Hi Dianne,

Thanks a lot for your suggestion. Problem has been solved as I had
passed the Context of the application as an argument of invoked method
display().

Regards,

Asif

On May 14, 10:22 am, Dianne Hackborn  wrote:
> You seem to be passing in a bad ContextWrapper that somehow has a null base
> pointer:
>
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
>   85     public Toast(Context context) {
>
>   86         mContext = context;
>
>   87         mTN = new TN(context);
>
>   88         mY = context.getResources().getDimensionPixelSize(
>
>   89                 com.android.internal.R.dimen.toast_y_offset);
>
>   90     }
>
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
>   76     @Override
>
>   77     public Resources getResources()
>
>   78     {
>
>   79         return mBase.getResources();
>
>   80     }
>
>
>
>
>
> On Wed, May 13, 2009 at 9:34 PM, Ask  wrote:
>
> > Fadden,
>
> >   It throws these exceptions only when " I tried to create any UI
> > component like Toast message or invoking phone dialer inents etc. " It
> > executes nicely when I just "tried to print a log message or created
> > MediaPlayer and playing a song "   .
>
> >  So my conclusion is that It throws NullPointerException only when
> > invoked code has a UI component.
>
> >  Note: same thing I had tried using the normal desktop java
> > application using swing and excuted nicely with UI component also. So
> > Is this a bug in android or some other way to do it.
>
> > Thanks,
>
> > Asif
>
> > On May 14, 3:28 am, fadden  wrote:
> > > On May 13, 8:05 am, Asif k  wrote:
>
> > > >    I had used DexClassLoader to execute the code of other application
> > > > dynamically. I am calling method display() of another application from
> > > > my application. The display() method will just show the Toast pop up.
> > > [...]
> > > > 05-13 20:10:22.336: WARN/System.err(773): Caused by:
> > > > java.lang.NullPointerException
> > > > 05-13 20:10:22.466: WARN/System.err(773):     at
> > > > android.content.ContextWrapper.getResources(ContextWrapper.java:79)
> > > > 05-13 20:10:22.466: WARN/System.err(773):     at
> > > > android.widget.Toast.(Toast.java:88)
> > > > 05-13 20:10:22.477: WARN/System.err(773):     at
> > > > android.widget.Toast.makeText(Toast.java:230)
> > > > 05-13 20:10:22.485: WARN/System.err(773):     ... 25 more
>
> > > > Please Help. Am I missing something??
>
> > > Looks like it was doing something and then hit a null pointer
> > > exception?
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: 1.5 api change - broken scrollbar resources

2009-05-13 Thread Romain Guy

The system scrollbar does not have a track anymore. Your code should
simply account for that possibility. The framework code does attempt
to load a scrollbar track but does not crash if no resource is
present.

On Wed, May 13, 2009 at 10:36 PM, Peter Carpenter
 wrote:
>
>
> Hi all,
>
> I've just been attempting to upgrade my application to support 1.5 and
> discovered that I can no longer retrieve a resource for my scrollbar
> background.
>
> My app requires me to draw a scrollbar that I can use to control a
> custom component.
>
> Currently I was using the following code (which Jeff was kind enough to
> point me in the right direction of):
>
> TypedValue val = new TypedValue();
> if (context.getTheme().resolveAttribute(
>       android.R.attr.scrollbarThumbVertical, val, true))
> {
>    scrollThumb = getResources().getDrawable(val.resourceId);
> }
> if (context.getTheme().resolveAttribute(
>       android.R.attr.scrollbarTrackVertical, val, true))
> {
>    scrollTrack = getResources().getDrawable(val.resourceId);
> }
>
> However the 2nd getDrawable causes a ResourceNotFound exception so it
> appears the scrollbarTrackVertical has been removed??
>
> Does anyone know of any other ways to get the system scrollbar
> drawables? (or a system scrollbar by itself?)
>
> Regards,
>
> Peter.
>
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Another AbsoluteLayout deprecation question

2009-05-13 Thread Romain Guy

Again, AbsoluteLayout was deprecated to encourage developers to use
"real" layout managers. AbsoluteLayout just won't work with other
screen resolutions and densities. Like Dianne said, it won't go away
but we want you guys to think very hard before using it. It is (most
of the time) bad practice and will only come back to haunt you in the
future.

On Wed, May 13, 2009 at 11:00 PM, Mark Murphy  wrote:
>
>> I believe I have politely and thoroughly stated my question.  Anyone
>> have an answer?
>
> Everybody, even to an extent the core Android team folk on this list, is
> contributing answers on a volunteer basis. Lots of questions get asked
> here that do not get answered, for any number of reasons.
>
> Also, bear in mind that you sent your question less than 24 hours ago. Not
> everybody monitors this list continuously. If you need answers in that
> short of a timeframe, hire a consultant.
>
> I have watched your thread since its inception. I did not reply at first,
> because you seemed set on having a core Android team member answer, and I
> am not such a person. However, since your focus now seems to be on getting
> some sort of answer from anyone, here's my take on it:
>
>>> > I have seen a number of threads discussing the deprecation
>>> ofAbsoluteLayout.  I'm a little fearful of reading third-party blogs
>>> > that suggest solutions to the deprecation because in some discussion
>>> > threads the Google employees have explicitly said the blogs contain
>>> > misunderstandings or inaccuracies.
>
> According to Ms. Hackborn's most recent(?) post on the topic, while
> AbsoluteLayout is deprecated, it is not going away. Strategically, I
> suppose that means no new code should be built that relies upon
> AbsoluteLayout, but there is no need for a massive rush to the exits to
> abandon AbsoluteLayout for existing code.
>
> Personally, if I were in your shoes, I would aim to eliminate my
> dependency on AbsoluteLayout in the next few months. Note that "eliminate
> the dependency on AbsoluteLayout" could be simply a mental bookmark that,
> should AbsoluteLayout ever be truly removed from the platform, that you
> will be willing and able to maintain AbsoluteLayout yourself, based on the
> last implementation found in the Android open source project.
>
> But, again, Ms. Hackborn has indicated AbsoluteLayout is not going away,
> and so you may elect to not worry about this issue in the near term.
>
>>> > So, I need to know how to implement my app's behavior
>>> withoutAbsoluteLayout.  I would greatly appreciate any input people
>>> might
>>> > have, especially the real pros, the Android dev team who, by
>>> > deprecatingAbsoluteLayout, must have a clear picture in their heads
>>> > of how to reorganize code to be up-to-date to achieve the same
>>> > functionality.  Romain Guy, Diane Hackborn, I'm looking your
>>> > direction.  :-)
>
> I believe both of them, in related threads, indicated that the solution is
> to create your own layout manager, rather than use AbsoluteLayout or
> RelativeLayout or any of the other built-in ones.
>
> Unfortunately, I am unaware of any tutorials on exactly how to do this.
> You can probably examine the source of some of the existing layout
> managers to see how they do what they do.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 2.0 Available!
>
>
>
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Another AbsoluteLayout deprecation question

2009-05-13 Thread Mark Murphy

> I believe I have politely and thoroughly stated my question.  Anyone
> have an answer?

Everybody, even to an extent the core Android team folk on this list, is
contributing answers on a volunteer basis. Lots of questions get asked
here that do not get answered, for any number of reasons.

Also, bear in mind that you sent your question less than 24 hours ago. Not
everybody monitors this list continuously. If you need answers in that
short of a timeframe, hire a consultant.

I have watched your thread since its inception. I did not reply at first,
because you seemed set on having a core Android team member answer, and I
am not such a person. However, since your focus now seems to be on getting
some sort of answer from anyone, here's my take on it:

>> > I have seen a number of threads discussing the deprecation
>> ofAbsoluteLayout.  I'm a little fearful of reading third-party blogs
>> > that suggest solutions to the deprecation because in some discussion
>> > threads the Google employees have explicitly said the blogs contain
>> > misunderstandings or inaccuracies.

According to Ms. Hackborn's most recent(?) post on the topic, while
AbsoluteLayout is deprecated, it is not going away. Strategically, I
suppose that means no new code should be built that relies upon
AbsoluteLayout, but there is no need for a massive rush to the exits to
abandon AbsoluteLayout for existing code.

Personally, if I were in your shoes, I would aim to eliminate my
dependency on AbsoluteLayout in the next few months. Note that "eliminate
the dependency on AbsoluteLayout" could be simply a mental bookmark that,
should AbsoluteLayout ever be truly removed from the platform, that you
will be willing and able to maintain AbsoluteLayout yourself, based on the
last implementation found in the Android open source project.

But, again, Ms. Hackborn has indicated AbsoluteLayout is not going away,
and so you may elect to not worry about this issue in the near term.

>> > So, I need to know how to implement my app's behavior
>> withoutAbsoluteLayout.  I would greatly appreciate any input people
>> might
>> > have, especially the real pros, the Android dev team who, by
>> > deprecatingAbsoluteLayout, must have a clear picture in their heads
>> > of how to reorganize code to be up-to-date to achieve the same
>> > functionality.  Romain Guy, Diane Hackborn, I'm looking your
>> > direction.  :-)

I believe both of them, in related threads, indicated that the solution is
to create your own layout manager, rather than use AbsoluteLayout or
RelativeLayout or any of the other built-in ones.

Unfortunately, I am unaware of any tutorials on exactly how to do this.
You can probably examine the source of some of the existing layout
managers to see how they do what they do.

-- 
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 Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Adb remount fails on Android 1.5

2009-05-13 Thread KG

I have figured out a way to do this...

First run "adb root" this will give you root access to G1's file
system, then you can execute commands like adb push, adb pull etc

--kartic

On May 13, 9:41 pm, Kartic  wrote:
> Hi All,
>
> I have upgraded my phone's images to Android 1.5 images 
> (fromhttp://www.htc.com/www/support/android/adp.html)
> Now when I try commands like adb remount, chmod, adb push etc I get
> "Operation not permitted" and "Permission denied" errors
>
> I was able to give this command when I had 1.0 images flashed on my
> phone.
>
> Has something related to permissions changed with Android 1.5?
>
> Regards,Kartic
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getting addresses from location

2009-05-13 Thread Android Users
Check this,

http://groups.google.com/group/android-developers/browse_thread/thread/79f94e31e647db60/aedf666aa0faa216?lnk=raot&pli=1


On Wed, May 13, 2009 at 2:55 PM, neoraptor  wrote:

>
> Hello,
>
> I have the same problem (code working on SDK 1.1 but not on 1.5).
> Does someone find a solution?
>
> Thanks
>
> On 16 avr, 17:32, zlu  wrote:
> > This code used to work in SDK1.1 but stopped working in1.5
> > I have a class that implements LocationListener
> >
> > in the onLocationChanged(Locationlocation) method I have:
> > Geocoder geocoder = new Geocoder(this, Locale.US);
> > try {
> >   List addresses = geocoder.getFromLocation
> > (location.getLatitude(),location.getLongitude(), 1);
> >
> > }.
> >
> > In emulator I send gps info, which is passed into thelocation
> > variable at runtime:
> > mLatitude=37.7841987667,mLongitude=-112.4020004334,
> > But the address List is empty.  In sdk 1.1 I get google's address on
> > shoreline, mtn view.
> >
> > Does anyone have any idea on how to solve this?
> >
> > Thanks,
> >
> > Zhao
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] 1.5 api change - broken scrollbar resources

2009-05-13 Thread Peter Carpenter


Hi all,

I've just been attempting to upgrade my application to support 1.5 and
discovered that I can no longer retrieve a resource for my scrollbar
background.

My app requires me to draw a scrollbar that I can use to control a
custom component.

Currently I was using the following code (which Jeff was kind enough to
point me in the right direction of):

TypedValue val = new TypedValue();
if (context.getTheme().resolveAttribute(
   android.R.attr.scrollbarThumbVertical, val, true))
{
scrollThumb = getResources().getDrawable(val.resourceId);
}
if (context.getTheme().resolveAttribute(
   android.R.attr.scrollbarTrackVertical, val, true))
{
scrollTrack = getResources().getDrawable(val.resourceId);
}

However the 2nd getDrawable causes a ResourceNotFound exception so it
appears the scrollbarTrackVertical has been removed??

Does anyone know of any other ways to get the system scrollbar
drawables? (or a system scrollbar by itself?)

Regards,

Peter.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Another AbsoluteLayout deprecation question

2009-05-13 Thread Keith Wiley

I believe I have politely and thoroughly stated my question.  Anyone
have an answer?

On May 13, 3:20 pm, Keith Wiley  wrote:
> Bump.  Thanks for any input.
>
> On May 13, 10:27 am, Keith Wiley  wrote:
>
> > I have seen a number of threads discussing the deprecation 
> > ofAbsoluteLayout.  I'm a little fearful of reading third-party blogs
> > that suggest solutions to the deprecation because in some discussion
> > threads the Google employees have explicitly said the blogs contain
> > misunderstandings or inaccuracies.
>
> > So, I need to know how to implement my app's behavior 
> > withoutAbsoluteLayout.  I would greatly appreciate any input people might
> > have, especially the real pros, the Android dev team who, by
> > deprecatingAbsoluteLayout, must have a clear picture in their heads
> > of how to reorganize code to be up-to-date to achieve the same
> > functionality.  Romain Guy, Diane Hackborn, I'm looking your
> > direction.  :-)
>
> > The relevant part of my app is a single large View covering the
> > majority of the screen, a subclass of my own creation, whose onDraw
> > basically paints a complicated bitmapped canvas.  Subsequently, I
> > repeatedly add and remove (or set visibility to VISIBLE and GONE,
> > that's actually the approach I've taken) an EditText (also subclasses
> > with unique behavior) which I must frequently reposition to pixel
> > precision over the background canvas.  I currently do this by setting
> > up a new LayoutParams with the EditText's new location and then
> > callingAbsoluteLayout.updateViewLayout on the EditText.  Works like a
> > charm.
>
> > So, a single screen-spanning View drawn with a bitmap, overlaid with a
> > single EditText which must be positioned to pixel precision, and set
> > VISIBLE and GONE periodically, and be moved from location to location
> > from time to time.
>
> > Million dollar question: Without usingAbsoluteLayout, what is the
> > official Android/Google endorsed method for implementing this
> > behavior?  FrameLayout and RelativeLayout seem -- at the least --
> > rather indirect in this situation whereAbsoluteLayoutprovides a
> > literal interpretation of my app's behavior: one view positioned
> > arbitrarily over another view.  Am I incorrect?  Can one or both of
> > them achieve this behavior as painlessly asAbsoluteLayout?
>
> > Thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Threading and Message Loops

2009-05-13 Thread radarcg

I replaced my threading code with the AsyncTask, and its such a direct
solution for my issue that I don't need to post my code. The
references listed above provided all the solutions. Also, the
stacktrace also seemed to be caused by the reason stated above because
it too went away with this solution. Thanks again!

On May 13, 1:37 pm, radarcg  wrote:
> Thanks to you both for this information, it sounds like its exactly
> what I was looking for. It is appreciated, thanks for your
> contributions to the community. I'll pay back by posting results...
>
> On May 12, 6:41 pm, Dianne Hackborn  wrote:
>
>
>
> > The error means that this Message object has already been posted to a
> > queue.  It probably means that somewhere you are keeping  a Message that you
> > received from a Handler (the Handler owns the message and will recycle it
> > when returning from your code), or otherwise cause a Message to get recycled
> > that is also being posted into a Handler.
>
> > On Tue, May 12, 2009 at 6:04 PM,radarcg wrote:
>
> > > Ok, I'm really struggling with what is likely a simple issue. All I
> > > really want to do is have an activity spawn a thread to do a non-
> > > trivial action (for now, just testing with sleep(5000) ). Then, when
> > > that non-trivial action completes,  the thread should notify the
> > > activity, and the activity should present something visual, and
> > > proceed. Simple enough right? I'm trying to use a Handler subclass to
> > > which I send messages using sendMessage(). That handler subclass with
> > > then notify the activity. It all seems to work actually, but then when
> > > the thread completes, android is throwing an unhelpful exception:
>
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073): *** Uncaught remote
> > > exception!  (Exceptions are not yet supported across processes.)
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):
> > > android.util.AndroidRuntimeException: { what=1004 when=4149225
> > > arg2=1 } This message is already in use.
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > > android.os.MessageQueue.enqueueMessage(MessageQueue.java:173)
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > > android.os.Handler.sendMessageAtTime(Handler.java:457)
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > > android.os.Handler.sendMessageDelayed(Handler.java:430)
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > > android.os.Handler.sendMessage(Handler.java:367)
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > > android.view.ViewRoot.windowFocusChanged(ViewRoot.java:2421)
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > > android.view.ViewRoot$W.windowFocusChanged(ViewRoot.java:2594)
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at android.view.IWindow
> > > $Stub.onTransact(IWindow.java:166)
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > > android.os.Binder.execTransact(Binder.java:287)
> > > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > > dalvik.system.NativeStart.run(Native Method)
>
> > > As a seasoned Java developer, running into trouble like this so early
> > > in a new project is frustrating. However, I believe in Android and the
> > > broader Google development platforms, so I'd really like to solve
> > > this, but I think I need the communities help. Even just some sample
> > > code (skeleton apps) that demo some best practices regarding the
> > > threading (such as usage of HandlerThread and Looper) would be a big
> > > help.
>
> > > Thanks,
>
> > > Charles
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] No Pig Fats in Lays | Certificate from Pepsi Pakistan

2009-05-13 Thread meh.altaf
see details
http://emailzz.blogspot.com/2009/05/no-pig-fats-in-lays-certificate-from.html


   - Best and Worst Brain Foods By David Zinczenko,
wit...
   - Miracle Found at Hanif's Butcher in
Fordsburg
   - No Pig Fats in Lays | Certificate from Pepsi
Pakis...
   - New Long 
Hairstyles
   - the Major Loan
Organizations
   - The Student Loan
Companies
   - Yahoo Domain Name
Features
   - Mesothelioma & Suggested Steps Following
Diagnosis...
   - Insurance in
Islam
   - what is Forex Club
(FXClub)


Apnay Classified Ads

   - Models 
Required
   - Good Condition Flat For
Sale
   - Apartment For
Rent
   - 
Marriage
   - Looking for a
Groom


Politics of Pakistan

   - Scandals of the PAK Cricket
Team
   - Firing in Karachi Near Johar Complex, 2
killed
   - Land mafia occupies valuable land allotted to
poor
   - Tyco 
International
   - Kanebo 
Limited

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: DexClassLoader caould not invoke method from another application properly

2009-05-13 Thread Dianne Hackborn
You seem to be passing in a bad ContextWrapper that somehow has a null base
pointer:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/Toast.java;h=ff747878fba0ddf7b9a477a11f0fdd5a3821bb62;hb=HEAD

  85 public Toast(Context context) {

  86 mContext = context;

  87 mTN = new TN(context);

  88 mY = context.getResources().getDimensionPixelSize(

  89 com.android.internal.R.dimen.toast_y_offset);

  90 }

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/content/ContextWrapper.java;h=36e1c340d1d98f12b2ef87c1580268f5f593b908;hb=HEAD

  76 @Override

  77 public Resources getResources()

  78 {

  79 return mBase.getResources();

  80 }

On Wed, May 13, 2009 at 9:34 PM, Ask  wrote:

>
> Fadden,
>
>   It throws these exceptions only when " I tried to create any UI
> component like Toast message or invoking phone dialer inents etc. " It
> executes nicely when I just "tried to print a log message or created
> MediaPlayer and playing a song "   .
>
>  So my conclusion is that It throws NullPointerException only when
> invoked code has a UI component.
>
>  Note: same thing I had tried using the normal desktop java
> application using swing and excuted nicely with UI component also. So
> Is this a bug in android or some other way to do it.
>
> Thanks,
>
> Asif
>
> On May 14, 3:28 am, fadden  wrote:
> > On May 13, 8:05 am, Asif k  wrote:
> >
> > >I had used DexClassLoader to execute the code of other application
> > > dynamically. I am calling method display() of another application from
> > > my application. The display() method will just show the Toast pop up.
> > [...]
> > > 05-13 20:10:22.336: WARN/System.err(773): Caused by:
> > > java.lang.NullPointerException
> > > 05-13 20:10:22.466: WARN/System.err(773): at
> > > android.content.ContextWrapper.getResources(ContextWrapper.java:79)
> > > 05-13 20:10:22.466: WARN/System.err(773): at
> > > android.widget.Toast.(Toast.java:88)
> > > 05-13 20:10:22.477: WARN/System.err(773): at
> > > android.widget.Toast.makeText(Toast.java:230)
> > > 05-13 20:10:22.485: WARN/System.err(773): ... 25 more
> >
> > > Please Help. Am I missing something??
> >
> > Looks like it was doing something and then hit a null pointer
> > exception?
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem installing application onto HTC Magic

2009-05-13 Thread Android Users
Do we get the Google APIs addon for download? Or is there anyway to upgrade
the device to support maps? If so please provide a way to do so.
Thanks in advance. Hoping for a quick response.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Screen/Activity orientation

2009-05-13 Thread doubleslash

Situation:
 I set my activity to be in landscape mode. In this activity, I move a
box along the x direction, which is along the longer side of the phone
due to being in landscape. When the activity is first started,
everything works great--the x axis in my code corresponds to the
expected x direction in landscape.

Problem:  if in the middle of running it, I go into the dialer app by
pressing the call button, and then going back to my app, the box still
moves in the "x direction" but now perpendicular to the supposed
landscape x direction. I suppose the dialer's portrait mode got passed
onto my activity even though the orientation is set to landscape in
the manifest.

Attempts: I have tried numerous ways to remedy this but to no avail. I
tried re-initialzing all my views, calling setContentView upon
Restart. I also tried to get my orientation by calling
getResources().getConfiguration().orientation. The result indicates
"landscape" although the x axis now is perpendicular to before.

Please help! How do you deal with orientation change
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: dialog is getting dismissed when I am flipping the device

2009-05-13 Thread Android Users
Hi Dianne,
I suggested the way i followed to retain the state of the dialog, which may
not be preferred. Thanks for the suggestion.
It would be good if you could provide a sample as to how to retain the state
after flipping, so that i could implement the same.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Send SMS Message

2009-05-13 Thread yves...@gmail.com

There are lots of post talking about sending SMS messages. But my
question is not answered there.

So, I can send sms messages using my app, but after the message is
sent, I can't find them in the "Messaging" app's outbox, you know,
like it list all incoming and outgoing messages. What I want to
accomplish is that whatever app user used to send text message, it
should show up in the "Messaging" app.

Any ideas on how to solve this?

I used smsManager.SendTextMessage call to send text message.





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem installing application onto HTC Magic

2009-05-13 Thread Xavier Ducrohet

If you develop an application that uses MapView (with your manifest
declaring a uses-library node with com.google.android.maps), it will
never install on a device that does not have Maps (actually Google
Maps is not required, it's the Google Maps library that is required.
I'm guessing if your device doesn't have the application, it doesn't
have the library either.)

The MapView class is not part of the standard API (its namespace is
not android.* but com.google.android.*), hence the reason it's now
published as part of the Google APIs add-on, and requires the
uses-library entry in the manifest.

Xav

On Wed, May 13, 2009 at 9:10 PM, Android Users  wrote:
>
> Any help on this?..
>
> On Mon, May 11, 2009 at 11:04 AM, Android Users 
> wrote:
>>
>> Hi Raphael,
>>
>> Thanks for your reply.
>>
>> Build number : 2.14.720.1 146733 CL#24595
>> Carrier : AIRTEL
>>
>>
>>
>> On Sun, May 10, 2009 at 3:37 AM, Raphael  wrote:
>>>
>>> On Fri, May 8, 2009 at 10:31 PM, Android Users 
>>> wrote:
>>> > Hi all,
>>> > I am not able to install any map related application onto my HTC magic
>>>
>>> Before we can help you, you'd have to tell us what build your magic is
>>> running: home > settings > about phone > build number. From which
>>> carrier did you get it?
>>>
>>> > device. it is giving the a exception
>>> > saying INSTALL_FAILED_MISSING_SHARED_LIBRARY.
>>> > I have built the application onto Target 3 (Google APIs). Am i missing
>>> > something while creating a map application in android 1.5?
>>> > Any suggestions to resolve this issue?
>>> > Also the device doesn't have the default Maps application which was
>>> > present
>>> > in G1 device.
>>>
>>> The error message is pretty obvious: "missing shared library". And you
>>> add that your device doesn't have maps. A+B=you're trying to use maps
>>> on a device that doesn't have maps, so it doesn't work. Thus my
>>> initial question: what build is that?
>>>
>>> R/
>>>
>>>
>>
>
>
> >
>



-- 
Xavier Ducrohet
Android Developer Tools Engineer
Google Inc.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: DexClassLoader caould not invoke method from another application properly

2009-05-13 Thread Ask

Fadden,

   It throws these exceptions only when " I tried to create any UI
component like Toast message or invoking phone dialer inents etc. " It
executes nicely when I just "tried to print a log message or created
MediaPlayer and playing a song "   .

  So my conclusion is that It throws NullPointerException only when
invoked code has a UI component.

  Note: same thing I had tried using the normal desktop java
application using swing and excuted nicely with UI component also. So
Is this a bug in android or some other way to do it.

Thanks,

Asif

On May 14, 3:28 am, fadden  wrote:
> On May 13, 8:05 am, Asif k  wrote:
>
> >    I had used DexClassLoader to execute the code of other application
> > dynamically. I am calling method display() of another application from
> > my application. The display() method will just show the Toast pop up.
> [...]
> > 05-13 20:10:22.336: WARN/System.err(773): Caused by:
> > java.lang.NullPointerException
> > 05-13 20:10:22.466: WARN/System.err(773):     at
> > android.content.ContextWrapper.getResources(ContextWrapper.java:79)
> > 05-13 20:10:22.466: WARN/System.err(773):     at
> > android.widget.Toast.(Toast.java:88)
> > 05-13 20:10:22.477: WARN/System.err(773):     at
> > android.widget.Toast.makeText(Toast.java:230)
> > 05-13 20:10:22.485: WARN/System.err(773):     ... 25 more
>
> > Please Help. Am I missing something??
>
> Looks like it was doing something and then hit a null pointer
> exception?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem installing application onto HTC Magic

2009-05-13 Thread Android Users
Any help on this?..

On Mon, May 11, 2009 at 11:04 AM, Android Users wrote:

> Hi Raphael,
>
> Thanks for your reply.
>
> Build number : 2.14.720.1 146733 CL#24595
> Carrier : AIRTEL
>
>
>
>
> On Sun, May 10, 2009 at 3:37 AM, Raphael  wrote:
>
>>
>> On Fri, May 8, 2009 at 10:31 PM, Android Users 
>> wrote:
>> > Hi all,
>> > I am not able to install any map related application onto my HTC magic
>>
>> Before we can help you, you'd have to tell us what build your magic is
>> running: home > settings > about phone > build number. From which
>> carrier did you get it?
>>
>> > device. it is giving the a exception
>> > saying INSTALL_FAILED_MISSING_SHARED_LIBRARY.
>> > I have built the application onto Target 3 (Google APIs). Am i missing
>> > something while creating a map application in android 1.5?
>> > Any suggestions to resolve this issue?
>> > Also the device doesn't have the default Maps application which was
>> present
>> > in G1 device.
>>
>> The error message is pretty obvious: "missing shared library". And you
>> add that your device doesn't have maps. A+B=you're trying to use maps
>> on a device that doesn't have maps, so it doesn't work. Thus my
>> initial question: what build is that?
>>
>> R/
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: opengl 纹理映射

2009-05-13 Thread xiaofeng

now i found the problem is in the following code.Maybe the following
process loses some important data;can give me some code about this?
现在我确定问题是在下面的对bmp图片作处理过程导致丢失了一些重要信息,或下面的算法有问题,有没有人有这方面的算法代码?

ByteBuffer bb = ByteBuffer.allocateDirect(bmp.getHeight()
*bmp.getWidth()*4);
bb.order(ByteOrder.BIG_ENDIAN);
IntBuffer ib = bb.asIntBuffer();
System.out.println("k=0 loadTexture 2 in
GLTutorialBase");

for (int y=bmp.getHeight()-1;y>-1;y--)
   for (int x=0;x RGBA
   @SuppressWarnings("unused")
   byte alpha = (byte)((pix >> 24)&0xFF);
   byte red = (byte)((pix >> 16)&0xFF);
   byte green = (byte)((pix >> 8)&0xFF);
   byte blue = (byte)((pix)&0xFF);

// It seems like alpha is currently broken in
Android...
   ib.put(red << 24 | green << 16 | blue << 8 |
0xFF);//255-alpha);
}

System.out.println("k=0 loadTexture 3 in
GLTutorialBase");

ib.position(0);
bb.position(0);

On 5月14日, 上午11时50分, xiaofeng  wrote:
>this is my code!是不是loadTexture里有问题?
>
>  protected static int loadTexture(GL10 gl,Bitmap bmp, boolean
> reverseRGB) {
>
> System.out.println("Eenter loadTexture in GLTutorialBase");
> int[] tmp_texture = new int[1];
> gl.glGenTextures(1, tmp_texture, 0);
> int texture = tmp_texture[0] ;//QQ
>
> System.out.println("k=0 loadTexture 1 in GLTutorialBase");
> ByteBuffer bb = ByteBuffer.allocateDirect(bmp.getHeight()
> *bmp.getWidth()*4);
> bb.order(ByteOrder.BIG_ENDIAN);
> IntBuffer ib = bb.asIntBuffer();
> System.out.println("k=0 loadTexture 2 in
> GLTutorialBase");
>
> for (int y=bmp.getHeight()-1;y>-1;y--)
>for (int x=0;xint pix = bmp.getPixel(x,bmp.getHeight()-y-1);
>// Convert ARGB -> RGBA
>@SuppressWarnings("unused")
>byte alpha = (byte)((pix >> 24)&0xFF);
>byte red = (byte)((pix >> 16)&0xFF);
>byte green = (byte)((pix >> 8)&0xFF);
>byte blue = (byte)((pix)&0xFF);
>
> // It seems like alpha is currently broken in
> Android...
>ib.put(red << 24 | green << 16 | blue << 8 |
> 0xFF);//255-alpha);
> }
>
> System.out.println("k=0 loadTexture 3 in
> GLTutorialBase");
>
> ib.position(0);
> bb.position(0);
> gl.glBindTexture(GL10.GL_TEXTURE_2D, texture);
> gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA,
> bmp.getWidth(), bmp.getHeight(), 0, GL10.GL_RGBA,
> GL10.GL_UNSIGNED_BYTE, bb);
> gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
> gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
> tmp_texture=null;
> ib.position(0);
> bb.position(0);
> ib.clear();
> bb.clear();
> System.out.println("k =0 Leave loadTexture in
> GLTutorialBase");
> return texture;
>
> }
>
> protected void init(GL10 gl) {
> gl.glEnable(GL10.GL_LIGHTING);
> gl.glEnable(GL10.GL_LIGHT0);
>
> gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbient,   
>   0);
> gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuse,   
>   0);
> gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPos, 0);
>
> gl.glEnable(GL10.GL_DEPTH_TEST);
> gl.glClearDepthf(1.0f);
> gl.glEnable(GL10.GL_TEXTURE_2D);
> gl.glEnable(GL10.GL_CULL_FACE);
> gl.glEnable(GL10.GL_CULL_FACE) ;
> gl.glCullFace(GL10.GL_BACK);
> gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
> gl.glClearDepthf(1.0f);
>
> gl.glVertexPointer(3, GL10.GL_FLOAT, 0, cubeBuff);
> gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
> gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuff);
> gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
>
> gl.glShadeModel(GL10.GL_SMOOTH);
>
> tex = loadTexture(gl, bmp0);
> tex1 = loadTexture(gl, bmp1);
> tex2 = loadTexture(gl, bmp2);
> tex3 = loadTexture(gl,bmp3);
>
> gl.glFogf(GL10.GL_FOG_MODE, GL10.GL_EXP);;
> gl.glFogfv(GL10.GL_FOG_COLOR, fogColor, 0);
> gl.glFogf(GL10.GL_FOG_DENSITY, 0.75f);
> gl.glHint(GL10.GL_FOG_HINT, GL10.GL_DONT_CARE);
> gl.glFogf(GL10.GL_FOG_START, 1.0f);
> gl.glFogf(GL10.GL_FOG_END, 5.0f);
> gl

[android-developers] Re: Question: How to guestimate the available bitmap memory on a device

2009-05-13 Thread Dianne Hackborn
You can always catch the exception.

On Wed, May 13, 2009 at 4:59 PM, Todd  wrote:

>
> So, how does one programatically determine the amount of heap space
> free including space used by bitmap memory? Is there such a way? I
> would prefer to inform my users that there isn't enough memory to load
> their image rather than getting an OOM and have the app exit.
>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Post your ad for free + jobs opportunities

2009-05-13 Thread meh.altaf
Do u have something to sell .. ? aur wants to offer tution. ..
place your ad for free @ http://apnayads.blogspot.com/
Categories

   - Cellphone For
Sale
   (15)
   - Computer n
Accessories
   (6)
   - Dj required 
   (3)
   - For Rent  (6)
   - Jobs Ads  (1)
   - Matrimonial
Ads
   (17)
   - Miscellaneous 
   (11)
   - Property For
Sale
   (11)
   - Showbiz  (1)
   - Tutors  (26)
   - Vehicle For
Sale
   (16)


Jobs Opportunities

   - SUCCESS FACTOR FOR THE HR
MANAGER
   - FMCG Lahore
Required
   - Virtual University Admin
Manager
   - Train the Trainers by TUSDEC
-Lahore
   - EXPERIENCED SEOs - SEO Company in
Karachi

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: opengl 纹理映射

2009-05-13 Thread xiaofeng

   this is my code!是不是loadTexture里有问题?

 protected static int loadTexture(GL10 gl,Bitmap bmp, boolean
reverseRGB) {

System.out.println("Eenter loadTexture in GLTutorialBase");
int[] tmp_texture = new int[1];
gl.glGenTextures(1, tmp_texture, 0);
int texture = tmp_texture[0] ;//QQ

System.out.println("k=0 loadTexture 1 in GLTutorialBase");
ByteBuffer bb = ByteBuffer.allocateDirect(bmp.getHeight()
*bmp.getWidth()*4);
bb.order(ByteOrder.BIG_ENDIAN);
IntBuffer ib = bb.asIntBuffer();
System.out.println("k=0 loadTexture 2 in
GLTutorialBase");

for (int y=bmp.getHeight()-1;y>-1;y--)
   for (int x=0;x RGBA
   @SuppressWarnings("unused")
   byte alpha = (byte)((pix >> 24)&0xFF);
   byte red = (byte)((pix >> 16)&0xFF);
   byte green = (byte)((pix >> 8)&0xFF);
   byte blue = (byte)((pix)&0xFF);

// It seems like alpha is currently broken in
Android...
   ib.put(red << 24 | green << 16 | blue << 8 |
0xFF);//255-alpha);
}

System.out.println("k=0 loadTexture 3 in
GLTutorialBase");

ib.position(0);
bb.position(0);
gl.glBindTexture(GL10.GL_TEXTURE_2D, texture);
gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA,
bmp.getWidth(), bmp.getHeight(), 0, GL10.GL_RGBA,
GL10.GL_UNSIGNED_BYTE, bb);
gl.glTexParameterf(GL10.GL_TEXTURE_2D,
GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
gl.glTexParameterf(GL10.GL_TEXTURE_2D,
GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
tmp_texture=null;
ib.position(0);
bb.position(0);
ib.clear();
bb.clear();
System.out.println("k =0 Leave loadTexture in
GLTutorialBase");
return texture;
}


protected void init(GL10 gl) {
gl.glEnable(GL10.GL_LIGHTING);
gl.glEnable(GL10.GL_LIGHT0);

gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbient, 
0);
gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuse, 
0);
gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPos, 0);

gl.glEnable(GL10.GL_DEPTH_TEST);
gl.glClearDepthf(1.0f);
gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glEnable(GL10.GL_CULL_FACE);
gl.glEnable(GL10.GL_CULL_FACE) ;
gl.glCullFace(GL10.GL_BACK);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
gl.glClearDepthf(1.0f);

gl.glVertexPointer(3, GL10.GL_FLOAT, 0, cubeBuff);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuff);
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);

gl.glShadeModel(GL10.GL_SMOOTH);

tex = loadTexture(gl, bmp0);
tex1 = loadTexture(gl, bmp1);
tex2 = loadTexture(gl, bmp2);
tex3 = loadTexture(gl,bmp3);

gl.glFogf(GL10.GL_FOG_MODE, GL10.GL_EXP);;
gl.glFogfv(GL10.GL_FOG_COLOR, fogColor, 0);
gl.glFogf(GL10.GL_FOG_DENSITY, 0.75f);
gl.glHint(GL10.GL_FOG_HINT, GL10.GL_DONT_CARE);
gl.glFogf(GL10.GL_FOG_START, 1.0f);
gl.glFogf(GL10.GL_FOG_END, 5.0f);
gl.glEnable(GL10.GL_FOG);
}
protected void drawFrame(GL10 gl) {
if (fog) {
gl.glEnable(GL10.GL_FOG);
}
else {
gl.glDisable(GL10.GL_FOG);
}

gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();
GLU.gluLookAt(gl, 0, 0, 3, 0, 0, 0, 0, 1, 0);
gl.glPushMatrix();

gl.glRotatef(yrot, 0, 1, 0);
gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, 
matAmbient,
0);
gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE, 
matDiffuse,
0);

gl.glVertexPointer(3, GL10.GL_FLOAT, 0, cubeBuff);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuff);

Log.d(TAG,"before tBefore bind tex1");
gl.glNormal3f(0,0,1);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
//gl.glRotatef(-180,0, 0, 1);
gl.glBindTexture(GL10.GL_TEXTURE_2D, tex1);
gl.g

[android-developers] Re: Unified Database Populating Solution

2009-05-13 Thread toto

Hi
I have an offer for you
keep your dictionary as text file
zip it and store it in the asset or raw resource direcory
ZIP can provide really good results on text
use Java ZipInputStream to expand it to the SDCard
in you app , do background SQLlite buildup, simple do the population
on a different thread.
users will agree that upon running (not installing) your app they will
be slower or wait a bit
maybe consider some progress bar...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Eclipse : Unknown error: SDK is not loaded yet. * upgrade failed *

2009-05-13 Thread chrispix

Not sure what is going on. Running Windows Vista x64.
Not had really any problems with eclipse. I had to upgrade to 1.5 and
when I did that I got all kinds of install errors. So I said 'f-it'. I
decided to start over and downloaded the 1.5SDK, downloaded the
Eclipse for Java, Not Eclipse classic (someone said that was an
issue). So now I have Eclipse for Java (or something to that name).
Each time I try to compile it says 'Unknown Error: SDK is not loaded
yet'

Can someone assist me please? thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to know whether an app is installed or not

2009-05-13 Thread android app

And also how refund affects getInstalledPackages(int flags) with flags
set as GET_UNINSTALLED_PACKAGES?  ( If an order of a paid app in
cancelled / refunded)

On May 13, 11:23 pm, android app  wrote:
> For a paid app, the app will be still in the "My Downloads" even if it
> is uninstalled.  You can re-install the app from "My Downloads".
>
> I am looking into getInstalledPackages(int flags).  Just found an
> option for flags::GET_UNINSTALLED_PACKAGES, which may return
> applications with "DONT_DELETE_DATA".    HOPE this works.
>
> So now my question is about how refund affects the "My Downloads"
> list.  If an order of a paid app in cancelled / refunded, will and
> when the app disappear from "My Downloads"?
>
> Thanks, Johnny.
>
> On May 13, 11:12 pm, Johnny  wrote:
>
>
>
> > I think the results from the PackageManager is accurate.
>
> > The "My Downloads" is propobably saved the downloaded info in its own
> > provider.
>
> > One test, can you launch the application from "My Downloads" after
> > uninstall it?
>
> > On May 14, 11:07 am, android app  wrote:
>
> > > Thanks, Jeff.
>
> > > Can an app know whether another app was installed if it was
> > > uninstalled and is still in the "My Downloads" list?  A purchased
> > > application will still in the list of "My Downloads" even after it is
> > > uninstalled.
>
> > > On May 13, 11:00 pm, android app  wrote:
>
> > > > I mean programatically in an application.
>
> > > > How to write code in an application to know whether another app is
> > > > installed or not?
>
> > > > Thanks
>
> > > > On May 13, 10:57 pm, Johnny  wrote:
>
> > > > > Settings -> Applications -> Manage Applications
>
> > > > > On May 14, 10:53 am, android app  wrote:
>
> > > > > > how to know whether an app is installed or not?
>
> > > > > > Can an app access the list of application in "My Downloads"?- Hide 
> > > > > > quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to know whether an app is installed or not

2009-05-13 Thread android app

For a paid app, the app will be still in the "My Downloads" even if it
is uninstalled.  You can re-install the app from "My Downloads".

I am looking into getInstalledPackages(int flags).  Just found an
option for flags::GET_UNINSTALLED_PACKAGES, which may return
applications with "DONT_DELETE_DATA".HOPE this works.

So now my question is about how refund affects the "My Downloads"
list.  If an order of a paid app in cancelled / refunded, will and
when the app disappear from "My Downloads"?

Thanks, Johnny.

On May 13, 11:12 pm, Johnny  wrote:
> I think the results from the PackageManager is accurate.
>
> The "My Downloads" is propobably saved the downloaded info in its own
> provider.
>
> One test, can you launch the application from "My Downloads" after
> uninstall it?
>
> On May 14, 11:07 am, android app  wrote:
>
>
>
> > Thanks, Jeff.
>
> > Can an app know whether another app was installed if it was
> > uninstalled and is still in the "My Downloads" list?  A purchased
> > application will still in the list of "My Downloads" even after it is
> > uninstalled.
>
> > On May 13, 11:00 pm, android app  wrote:
>
> > > I mean programatically in an application.
>
> > > How to write code in an application to know whether another app is
> > > installed or not?
>
> > > Thanks
>
> > > On May 13, 10:57 pm, Johnny  wrote:
>
> > > > Settings -> Applications -> Manage Applications
>
> > > > On May 14, 10:53 am, android app  wrote:
>
> > > > > how to know whether an app is installed or not?
>
> > > > > Can an app access the list of application in "My Downloads"?- Hide 
> > > > > quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getRuntime().exec("su do seomthing") fails (exit code)

2009-05-13 Thread toto

Hi BiAji
yes, I had a spelling mistake
the firmware is made by Jesus Freak

anyway the supplied terminal emulation in JF ADP1.5 does perform su
(after approving the popup window) actions with no problem. just
verified.
maybe dear Mr. JF modified some sources




On 14 מאי, 04:27, biAji  wrote:
> I'm not understand what is the "JS firmware", do you mean "JF"?
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to know whether an app is installed or not

2009-05-13 Thread Johnny

I think the results from the PackageManager is accurate.

The "My Downloads" is propobably saved the downloaded info in its own
provider.

One test, can you launch the application from "My Downloads" after
uninstall it?

On May 14, 11:07 am, android app  wrote:
> Thanks, Jeff.
>
> Can an app know whether another app was installed if it was
> uninstalled and is still in the "My Downloads" list?  A purchased
> application will still in the list of "My Downloads" even after it is
> uninstalled.
>
> On May 13, 11:00 pm, android app  wrote:
>
> > I mean programatically in an application.
>
> > How to write code in an application to know whether another app is
> > installed or not?
>
> > Thanks
>
> > On May 13, 10:57 pm, Johnny  wrote:
>
> > > Settings -> Applications -> Manage Applications
>
> > > On May 14, 10:53 am, android app  wrote:
>
> > > > how to know whether an app is installed or not?
>
> > > > Can an app access the list of application in "My Downloads"?- Hide 
> > > > quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ActivityInfo is null in Intrumentation class

2009-05-13 Thread Johnny

Could you paste also the two manifest file?

On Apr 28, 7:05 pm, "a...@lg"  wrote:
> @Override
>     public void onStart() {
>         super.onStart();
> _intent = new Intent(Intent.ACTION_MAIN);
> _intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> _intent = _intent.setClass(getTargetContext(), ClassUnderTest.class);
> ActivityInfo ai = _intent.resolveActivityInfo(getTargetContext
> ().getPackageManager(), 0);
>         if (ai != null) {
>                    ClassUnderTest activity = (ClassUnderTest)
> startActivitySync(_intent);
>         }
>
> }
>
> This a part of my code in my Instrumentation class. Earlier, i got a
> run time Exception,Quote:
> java.lang.RuntimeException: Unable to resolve activity for: Intent
> { flags=0x1000 comp={com.android.test.ui/
> com.android.test.ui.ClassUnderTest} }.
>
> Later on, i checked the activity info which is always null. How to set
> the ActivityInfo..? What is required to update in the code?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to know whether an app is installed or not

2009-05-13 Thread android app

Thanks, Jeff.

Can an app know whether another app was installed if it was
uninstalled and is still in the "My Downloads" list?  A purchased
application will still in the list of "My Downloads" even after it is
uninstalled.

On May 13, 11:00 pm, android app  wrote:
> I mean programatically in an application.
>
> How to write code in an application to know whether another app is
> installed or not?
>
> Thanks
>
> On May 13, 10:57 pm, Johnny  wrote:
>
>
>
> > Settings -> Applications -> Manage Applications
>
> > On May 14, 10:53 am, android app  wrote:
>
> > > how to know whether an app is installed or not?
>
> > > Can an app access the list of application in "My Downloads"?- Hide quoted 
> > > text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to know whether an app is installed or not

2009-05-13 Thread Johnny

Yes, as Jeff suggested, PackageManager#getInstalledApplication and
getInstalledPackages is what you need.

On May 14, 11:00 am, android app  wrote:
> I mean programatically in an application.
>
> How to write code in an application to know whether another app is
> installed or not?
>
> Thanks
>
> On May 13, 10:57 pm, Johnny  wrote:
>
> > Settings -> Applications -> Manage Applications
>
> > On May 14, 10:53 am, android app  wrote:
>
> > > how to know whether an app is installed or not?
>
> > > Can an app access the list of application in "My Downloads"?- Hide quoted 
> > > text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: where to download android 1.5 r1 source code ?

2009-05-13 Thread Marco Nelissen
On Wed, May 13, 2009 at 7:51 PM, rain  wrote:

>
> I know I can find the source code from
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=summary
>
> but I'm not familiar with git, don't know how to download it from
> there.


That's why detailed instructions are provided. See
http://source.android.com/download

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: where to download android 1.5 r1 source code ?

2009-05-13 Thread Johnny

I'm afraid you'll have to get familiar with git and repo.

If you want to work with the source code.

There is nowhere to find a single zip file of the source code, that's
a too old way for code distributions.

On May 14, 10:51 am, rain  wrote:
> I know I can find the source code 
> fromhttp://android.git.kernel.org/?p=platform/frameworks/base.git;a=summary
>
> but I'm not familiar with git, don't know how to download it from
> there.
>
> where to find a zip archive file about the source code?
>
> I donot know why the sdk don't contain the source code.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: where to download android 1.5 r1 source code ?

2009-05-13 Thread Jeff Sharkey

There are several git tutorials across the web, and there are a nice
set of instructions on how to get the Android source here:

http://source.android.com/download

j

On Wed, May 13, 2009 at 7:51 PM, rain  wrote:
>
> I know I can find the source code from
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=summary
>
> but I'm not familiar with git, don't know how to download it from
> there.
>
> where to find a zip archive file about the source code?
>
> I donot know why the sdk don't contain the source code.
> >
>



-- 
Jeff Sharkey
jshar...@google.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to know whether an app is installed or not

2009-05-13 Thread android app

I mean programatically in an application.

How to write code in an application to know whether another app is
installed or not?

Thanks

On May 13, 10:57 pm, Johnny  wrote:
> Settings -> Applications -> Manage Applications
>
> On May 14, 10:53 am, android app  wrote:
>
>
>
> > how to know whether an app is installed or not?
>
> > Can an app access the list of application in "My Downloads"?- Hide quoted 
> > text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to know whether an app is installed or not

2009-05-13 Thread Jeff Sharkey

You can programatically access all packages installed.  Something like
PackageManager.getInstalledApplications() is probably what you're
looking for:

http://d.android.com/reference/android/content/pm/PackageManager.html

j

On Wed, May 13, 2009 at 7:57 PM, Johnny  wrote:
>
> Settings -> Applications -> Manage Applications
>
> On May 14, 10:53 am, android app  wrote:
>> how to know whether an app is installed or not?
>>
>> Can an app access the list of application in "My Downloads"?
> >
>



-- 
Jeff Sharkey
jshar...@google.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: dynamically setting drawSelectorOnTop

2009-05-13 Thread damnesia

Yeah, I saw it in the documentation online but when I do
spinner.setDrawSelectorOnTop(true); I get "The method
setDrawSelectorOnTop(boolean) is undefined for the type Spinner".

I am using Android android-sdk-linux_x86-1.1_r1. Do I need to upgrade?

Thank you for your time.


On May 13, 2:59 pm, Romain Guy  wrote:
> It's in the documentation :) Hint, look for setDrawSelectorOnTop(boolean).
>
> On Wed, May 13, 2009 at 2:53 PM, damnesia  wrote:
>
> > Is it possible to dynamically set the drawSelectorOnTop attribute on a
> > Spinner instead of having to do it in the layout XML?
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to know whether an app is installed or not

2009-05-13 Thread Johnny

Settings -> Applications -> Manage Applications

On May 14, 10:53 am, android app  wrote:
> how to know whether an app is installed or not?
>
> Can an app access the list of application in "My Downloads"?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: webView: How to click a web link and display in my WebView app

2009-05-13 Thread Jerry Fan
I got the answer by myself. If anyone is also interested to know how to do
it, please go to below URL for a tutorial.
http://developer.android.com/guide/tutorials/views/hello-webview.html

On Thu, May 14, 2009 at 8:01 AM, jerryfan2000 wrote:

>
> Hi,
> I am trying to add a webview in my app to display a web page. However,
> every time I click link on the web page, Browser will be launched to
> display content in that link. I understand it is something about
> intent but I am still wondering is there any simpler method to ask
> webview to display link content within its View ? Thanks.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] how to know whether an app is installed or not

2009-05-13 Thread android app

how to know whether an app is installed or not?

Can an app access the list of application in "My Downloads"?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] where to download android 1.5 r1 source code ?

2009-05-13 Thread rain

I know I can find the source code from
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=summary

but I'm not familiar with git, don't know how to download it from
there.

where to find a zip archive file about the source code?

I donot know why the sdk don't contain the source code.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ActivityInfo is null in Intrumentation class

2009-05-13 Thread iqueen

try intent.setClassName("com.abc.def", "abc.def.ClassUnderTest");

On Apr 28, 7:05 pm, "a...@lg"  wrote:
> @Override
>     public void onStart() {
>         super.onStart();
> _intent = new Intent(Intent.ACTION_MAIN);
> _intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> _intent = _intent.setClass(getTargetContext(), ClassUnderTest.class);
> ActivityInfo ai = _intent.resolveActivityInfo(getTargetContext
> ().getPackageManager(), 0);
>         if (ai != null) {
>                    ClassUnderTest activity = (ClassUnderTest)
> startActivitySync(_intent);
>         }
>
> }
>
> This a part of my code in my Instrumentation class. Earlier, i got a
> run time Exception,Quote:
> java.lang.RuntimeException: Unable to resolve activity for: Intent
> { flags=0x1000 comp={com.android.test.ui/
> com.android.test.ui.ClassUnderTest} }.
>
> Later on, i checked the activity info which is always null. How to set
> the ActivityInfo..? What is required to update in the code?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: About SQLite (query)

2009-05-13 Thread Daehoon Jeon
Thanks for help...I have already figure it out, thank you anyway.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: problems with my htc magic

2009-05-13 Thread Johnny

Have you tried this:
http://developer.android.com/guide/developing/device.html#setting-up ?

On May 14, 7:25 am, petunio  wrote:
> Hi everybody
>
> I am trying to install apk's in my new htc magic
>
> I had before a G1 and I didn't found any problem, just doing adb
> install myapp.apk and that's it
>
> now, when I do the same with my htc, it says "error: device not found"
> Also, I noticed that if I type "adb devices", I dont get any device
> shown...
>
> I have also done the following settings in the mobile, with no luck:
>
> settings->applications->unknown sources (checked)
> settings->applications->development->usb debugging (checked)
> settings->applications->development->allow mock locations (checked)
>
> I know that is not a problem with the usb cable, as I have tried a few
> of them, including the one that was working with the G1...
> It could be a problem with the usb drivers, but everything seems fine
> in my device manager...
>
> has anybody come across this problem?
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: About SQLite (query)

2009-05-13 Thread Johnny

You should use

"select * from notes2 where title=\"" + str + "\""

On 5月14日, 上午10时12分, Daehoon Jeon  wrote:
> How to use rawQuery with Variable?
>
> Cursor mCursor = mDb.rawQuery("select * from notes2 where title=\"title1\"",
> null);
> it's worked
> but I want to use variable instead of String... like this
> String str = "title1";
> Cursor mCursor = mDb.rawQuery("select * from notes2 where title= str",
> null);
> it's stopped unexpected. Could anyone tell me how to use?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: About SQLite (query)

2009-05-13 Thread Daehoon Jeon
How to use rawQuery with Variable?

Cursor mCursor = mDb.rawQuery("select * from notes2 where title=\"title1\"",
null);
it's worked
but I want to use variable instead of String... like this
String str = "title1";
Cursor mCursor = mDb.rawQuery("select * from notes2 where title= str",
null);
it's stopped unexpected. Could anyone tell me how to use?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getRuntime().exec("su do seomthing") fails (exit code)

2009-05-13 Thread biAji

I'm not understand what is the "JS firmware", do you mean "JF"?

Actually , the emulator can not exec "su" correctly,  it will return
value 1 and error of "su: uid XXX not allowed to su" .  If you using
JF firmware, It will exec correctly. BUT...you should allow it to exec
in superuser app.

On May 12, 12:59 pm, toto  wrote:
> hi
> I work on rooted unlocked G1, latest JS firmware ADP1.5
> I wrote some application that perform some root actions in the /system
> of course, when messing up /system requires to remount that partition
> but that's not my issue.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] About SQLite (query)

2009-05-13 Thread daehoon

Hi everyone.
I know db.query was written like below in Android sample.
I want to use other field instead of rowId witch is KEY_DATE,
but it's not worked as well.

public Cursor fetchNote(long rowId) throws SQLException {
Cursor mCursor =
mDb.query(true, DATABASE_TABLE, new String[]
{KEY_ROWID,
KEY_TITLE,  KEY_BODY, KEY_DATE}, KEY_ROWID +
"=" + rowId, null, null, null, null, null);

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] simple MediaController example

2009-05-13 Thread kostmo

Hi,
I would like to show the MediaController (http://developer.android.com/
reference/android/widget/MediaController.html) view (with the play/
pause buttons and progress bar) when a button is pressed.

The backend passed to setMediaPlayer() is a
MediaController.MediaPlayerControl implementation that simply returns
constant values for the progress.  I intend to hook these methods up
to something more complicated later.

The expected behavior is for the MediaController window to be
displayed for 10 seconds when the button is clicked.  Instead, nothing
is displayed when the button is clicked.


The code I have tried is below:
-

package com.example.android.helloactivity;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.MediaController;


public class HelloActivity extends Activity {

private MediaController mc;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

LinearLayout v = new LinearLayout(this);
setContentView(v);

mc = new MediaController(this);
mc.setMediaPlayer(player_interface);
mc.setEnabled(true);
mc.setAnchorView(v);

Button b = new Button(this);
b.setText("show the player");
b.setOnClickListener(my_click_listener);

v.addView(b);
}


private View.OnClickListener my_click_listener = new
View.OnClickListener() {
public void onClick(View v) {

mc.show(10);
Log.d("mydebug", "button clicked.");
}
};

private MediaController.MediaPlayerControl player_interface = new
MediaController.MediaPlayerControl() {

public int getBufferPercentage() {
return 75;
}

public int getCurrentPosition() {
return 25;
}

public int getDuration() {
return 180;
}

public boolean isPlaying() {
return true;
}

public void pause() {
}

public void seekTo(int pos) {
}

public void start() {
}
};
}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] webView: How to click a web link and display in my WebView app

2009-05-13 Thread jerryfan2000

Hi,
I am trying to add a webview in my app to display a web page. However,
every time I click link on the web page, Browser will be launched to
display content in that link. I understand it is something about
intent but I am still wondering is there any simpler method to ask
webview to display link content within its View ? Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question: How to guestimate the available bitmap memory on a device

2009-05-13 Thread Todd

So, how does one programatically determine the amount of heap space
free including space used by bitmap memory? Is there such a way? I
would prefer to inform my users that there isn't enough memory to load
their image rather than getting an OOM and have the app exit.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] problems with my htc magic

2009-05-13 Thread petunio

Hi everybody

I am trying to install apk's in my new htc magic

I had before a G1 and I didn't found any problem, just doing adb
install myapp.apk and that's it

now, when I do the same with my htc, it says "error: device not found"
Also, I noticed that if I type "adb devices", I dont get any device
shown...

I have also done the following settings in the mobile, with no luck:

settings->applications->unknown sources (checked)
settings->applications->development->usb debugging (checked)
settings->applications->development->allow mock locations (checked)

I know that is not a problem with the usb cable, as I have tried a few
of them, including the one that was working with the G1...
It could be a problem with the usb drivers, but everything seems fine
in my device manager...


has anybody come across this problem?

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: DexClassLoader caould not invoke method from another application properly

2009-05-13 Thread fadden

On May 13, 8:05 am, Asif k  wrote:
>    I had used DexClassLoader to execute the code of other application
> dynamically. I am calling method display() of another application from
> my application. The display() method will just show the Toast pop up.
[...]
> 05-13 20:10:22.336: WARN/System.err(773): Caused by:
> java.lang.NullPointerException
> 05-13 20:10:22.466: WARN/System.err(773):     at
> android.content.ContextWrapper.getResources(ContextWrapper.java:79)
> 05-13 20:10:22.466: WARN/System.err(773):     at
> android.widget.Toast.(Toast.java:88)
> 05-13 20:10:22.477: WARN/System.err(773):     at
> android.widget.Toast.makeText(Toast.java:230)
> 05-13 20:10:22.485: WARN/System.err(773):     ... 25 more
>
> Please Help. Am I missing something??

Looks like it was doing something and then hit a null pointer
exception?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getRuntime().exec("su do seomthing") fails (exit code)

2009-05-13 Thread fadden

On May 12, 11:02 pm, toto  wrote:
> I have a theory
> since terminal application is signed with same certificate as the
> system certificate it has the ability to perform superuser actions
> What you probably meant is that a 3rd party applications (which are
> signed with different keys) won't pass the authorization rules.
> is my theory getting close?

It's even simpler than that.  In system/extras/su/su.c:

if (myuid != AID_ROOT && myuid != AID_SHELL) {
fprintf(stderr,"su: uid %d not allowed to su\n", myuid);
return 1;
}

So it should not work in the terminal application, but it should work
from "adb shell".

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question: How to guestimate the available bitmap memory on a device

2009-05-13 Thread fadden

On May 13, 1:17 pm, Streets Of Boston  wrote:
> According to the heap 'browser' that comes with the ADT plugin in
> Eclipse.
> My app is using less than 4MByte (it's using about 2MByte) but it
> won't allow me to create a bitmap of 12MByte.

Something to play with: grab http://bigflake.com/gclog.py.txt and run
it.  It will format the GC events from the device event log.  You'll
see stuff like this:

05-13 15:07:35 acore(2600) softlim=6464KB, extlim=2368KB,
extalloc=2368KB
  freed 1024 objects / 46336 bytes in 138ms

softlim + extlim may not exceed 16MB.  (It's actually more complex
than that, but that's a good approximation.)  "extlim" is the amount
of space currently being set aside for bitmaps, while "softlim" is the
virtual heap soft limit.

You will see GC events for all processes -- the script doesn't have
any fancy filtering features yet -- so you need to search for your
app.  The above is from process 2600 (acore).

This won't provide any detail about what's going on, but it may give
you a better sense of how things are allocated.  For example, if
softlim+extlim exceeds 4MB, a 12MB bitmap allocation is not going to
succeed.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Another AbsoluteLayout deprecation question

2009-05-13 Thread Keith Wiley

Bump.  Thanks for any input.

On May 13, 10:27 am, Keith Wiley  wrote:
> I have seen a number of threads discussing the deprecation ofAbsoluteLayout.  
> I'm a little fearful of reading third-party blogs
> that suggest solutions to the deprecation because in some discussion
> threads the Google employees have explicitly said the blogs contain
> misunderstandings or inaccuracies.
>
> So, I need to know how to implement my app's behavior withoutAbsoluteLayout.  
> I would greatly appreciate any input people might
> have, especially the real pros, the Android dev team who, by
> deprecatingAbsoluteLayout, must have a clear picture in their heads
> of how to reorganize code to be up-to-date to achieve the same
> functionality.  Romain Guy, Diane Hackborn, I'm looking your
> direction.  :-)
>
> The relevant part of my app is a single large View covering the
> majority of the screen, a subclass of my own creation, whose onDraw
> basically paints a complicated bitmapped canvas.  Subsequently, I
> repeatedly add and remove (or set visibility to VISIBLE and GONE,
> that's actually the approach I've taken) an EditText (also subclasses
> with unique behavior) which I must frequently reposition to pixel
> precision over the background canvas.  I currently do this by setting
> up a new LayoutParams with the EditText's new location and then
> callingAbsoluteLayout.updateViewLayout on the EditText.  Works like a
> charm.
>
> So, a single screen-spanning View drawn with a bitmap, overlaid with a
> single EditText which must be positioned to pixel precision, and set
> VISIBLE and GONE periodically, and be moved from location to location
> from time to time.
>
> Million dollar question: Without usingAbsoluteLayout, what is the
> official Android/Google endorsed method for implementing this
> behavior?  FrameLayout and RelativeLayout seem -- at the least --
> rather indirect in this situation whereAbsoluteLayoutprovides a
> literal interpretation of my app's behavior: one view positioned
> arbitrarily over another view.  Am I incorrect?  Can one or both of
> them achieve this behavior as painlessly asAbsoluteLayout?
>
> Thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: JNI check failures when trying to use a configured SOCKS Proxy object...

2009-05-13 Thread fadden

On May 12, 6:53 pm, fadden  wrote:
> Are you including any of your own native code?  If not, this is likely
> a bug in the core libraries.

...and so it is.

OSNetworkSystem.java declares:

   static native InetAddress getHostByNameImpl(String addr,
   boolean preferIPv6Addresses) throws UnknownHostException;

That ends up here:

static jobject osNetworkSystem_getHostByNameImpl(JNIEnv* env, jclass
clazz,
   jstring nameStr, jboolean preferIPv6Addresses) {

which does this:

   jbyteArray addr = env->NewByteArray(4);
 ...
   return addr;

So, it's returning a byte array when an InetAddress object is
expected.

I'm not sure what a workaround would be.  For reference, here's the
stack trace (via a new extension to the "Check JNI" feature), using
the provided APK:

I/InetAddress( 2771): gethostbyaddr: getnameinfo: 192.168.1.4 =
192.168.1.4
W/dalvikvm( 2771): JNI WARNING: method declared to return 'Ljava/net/
InetAddress;' returned '[B'
W/dalvikvm( 2771):  failed in Lorg/apache/harmony/luni/
platform/OSNetworkSystem;.getHostByNameImpl
I/dalvikvm( 2771): "main" prio=5 tid=3 RUNNABLE
I/dalvikvm( 2771):   | group="main" sCount=0 dsCount=0 s=N
obj=0x40018e70
I/dalvikvm( 2771):   | sysTid=2771 nice=0 sched=0/0 handle=-1094144900
I/dalvikvm( 2771):   at
org.apache.harmony.luni.platform.OSNetworkSystem.getHostByNameImpl
(Native Method)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.platform.OSNetworkSystem.getHostByName
(OSNetworkSystem.java:389)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.net.PlainSocketImpl.socksGetServerAddress
(PlainSocketImpl.java:368)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.net.PlainSocketImpl.socksConnect
(PlainSocketImpl.java:380)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.net.PlainSocketImpl.connect
(PlainSocketImpl.java:224)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.net.PlainSocketImpl.connect
(PlainSocketImpl.java:521)
I/dalvikvm( 2771):   at java.net.Socket.connect(Socket.java:1019)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.
(HttpConnection.java:67)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager
$ConnectionPool.getHttpConnection(HttpConnectionManager.java:151)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection
(HttpConnectionManager.java:79)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection
(HttpURLConnection.java:828)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect
(HttpURLConnection.java:800)
I/dalvikvm( 2771):   at com.test.socks.Socks5ProxyTest.onStart
(Socks5ProxyTest.java:103)
I/dalvikvm( 2771):   at android.app.Instrumentation.callActivityOnStart
(Instrumentation.java:1205)
I/dalvikvm( 2771):   at android.app.Activity.performStart
(Activity.java:3490)
I/dalvikvm( 2771):   at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2302)
I/dalvikvm( 2771):   at android.app.ActivityThread.handleLaunchActivity
(ActivityThread.java:2346)
I/dalvikvm( 2771):   at android.app.ActivityThread.access$1800
(ActivityThread.java:112)
I/dalvikvm( 2771):   at android.app.ActivityThread$H.handleMessage
(ActivityThread.java:1751)
I/dalvikvm( 2771):   at android.os.Handler.dispatchMessage
(Handler.java:99)
I/dalvikvm( 2771):   at android.os.Looper.loop(Looper.java:123)
I/dalvikvm( 2771):   at android.app.ActivityThread.main
(ActivityThread.java:4021)
I/dalvikvm( 2771):   at java.lang.reflect.Method.invokeNative(Native
Method)
I/dalvikvm( 2771):   at java.lang.reflect.Method.invoke(Method.java:
521)
I/dalvikvm( 2771):   at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:841)
I/dalvikvm( 2771):   at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:599)
I/dalvikvm( 2771):   at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm( 2771):
E/dalvikvm( 2771): VM aborting

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Another AbsoluteLayout deprecation question

2009-05-13 Thread Keith Wiley

Bump.

On May 13, 10:27 am, Keith Wiley  wrote:
> I have seen a number of threads discussing the deprecation of
> AbsoluteLayout.  I'm a little fearful of reading third-party blogs
> that suggest solutions to the deprecation because in some discussion
> threads the Google employees have explicitly said the blogs contain
> misunderstandings or inaccuracies.
>
> So, I need to know how to implement my app's behavior without
> AbsoluteLayout.  I would greatly appreciate any input people might
> have, especially the real pros, the Android dev team who, by
> deprecating AbsoluteLayout, must have a clear picture in their heads
> of how to reorganize code to be up-to-date to achieve the same
> functionality.  Romain Guy, Diane Hackborn, I'm looking your
> direction.  :-)
>
> The relevant part of my app is a single large View covering the
> majority of the screen, a subclass of my own creation, whose onDraw
> basically paints a complicated bitmapped canvas.  Subsequently, I
> repeatedly add and remove (or set visibility to VISIBLE and GONE,
> that's actually the approach I've taken) an EditText (also subclasses
> with unique behavior) which I must frequently reposition to pixel
> precision over the background canvas.  I currently do this by setting
> up a new LayoutParams with the EditText's new location and then
> calling AbsoluteLayout.updateViewLayout on the EditText.  Works like a
> charm.
>
> So, a single screen-spanning View drawn with a bitmap, overlaid with a
> single EditText which must be positioned to pixel precision, and set
> VISIBLE and GONE periodically, and be moved from location to location
> from time to time.
>
> Million dollar question: Without using AbsoluteLayout, what is the
> official Android/Google endorsed method for implementing this
> behavior?  FrameLayout and RelativeLayout seem -- at the least --
> rather indirect in this situation where AbsoluteLayout provides a
> literal interpretation of my app's behavior: one view positioned
> arbitrarily over another view.  Am I incorrect?  Can one or both of
> them achieve this behavior as painlessly as AbsoluteLayout?
>
> Thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Framework support for detecting starting and stopping of activities

2009-05-13 Thread clemsongrad


Dianne,

Could you please shed any light on where i should look in 1.5 for this
launch information?   Atleast i can research on what is there instead
of reinventing the wheel.

-Best Regards,

On May 13, 4:00 pm, Dianne Hackborn  wrote:
> There is nothing in the SDK for this.  In 1.5 there is now some lauch
> information maintained by the system, which you can modify to have reported
> if you'd like, though it is pretty rudimentary (for each day, the number of
> times each .apk has been resumed, and the total duration it was resumed).
> You will need to build your own system to do anything like this though.
>
>
>
> On Wed, May 13, 2009 at 1:28 PM, clemsongrad  wrote:
>
> > To support usability studies on what applications are used, i want to
> > write a service that logs when an activity is started and also when it
> > has finished.  This is to understand how the users are using the
> > device:
>
> > One straightforward option is to have the applications modify, to
> > write this out.  But this is tedious having to modify all applications
> > and will not work esp with third party or built in applications.
>
> > Is there any alternatives that makes this simpler and easier?
>
> > BTW: Looking at the android framework source ActivityManagerNative
> > seems to be invoking a Binder interface when an Activity is started
> > and finished.  Any information on what this service is?   Is this
> > something i can tap into?
>
> > Apologizes if i am looking at the wrong code, my first foray in to the
> > framework code.
>
> > Any information or thoughts is greatly appreciated.
>
> > Thx!
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: dynamically setting drawSelectorOnTop

2009-05-13 Thread Romain Guy

It's in the documentation :) Hint, look for setDrawSelectorOnTop(boolean).

On Wed, May 13, 2009 at 2:53 PM, damnesia  wrote:
>
> Is it possible to dynamically set the drawSelectorOnTop attribute on a
> Spinner instead of having to do it in the layout XML?
>
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: opengl 纹理映射

2009-05-13 Thread Yusuf T. Mobile
你确定α价值?


Yusuf T. Mobile
的看法,意见和声明此电子邮件是那些作者只是以个人身份,并不一定代表的T Mobile美国公司


On May 13, 7:30 am, Wendal Chen  wrote:
> 能贴一下代码吗?
>
> 图片也可以
>
> On May 13, 8:31 pm, xiaofeng  wrote:
>
>
>
> > 原来色彩很清楚的图片贴在立方体表面后发黄?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Framework support for detecting starting and stopping of activities

2009-05-13 Thread Dianne Hackborn
I believe the class is UsageStatsService.  "adb shell dumpsys usagestats"
will dump its current data.

On Wed, May 13, 2009 at 2:21 PM, clemsongrad  wrote:

>
>
> Dianne,
>
> Could you please shed any light on where i should look in 1.5 for this
> launch information?   Atleast i can research on what is there instead
> of reinventing the wheel.
>
> -Best Regards,
>
> On May 13, 4:00 pm, Dianne Hackborn  wrote:
> > There is nothing in the SDK for this.  In 1.5 there is now some lauch
> > information maintained by the system, which you can modify to have
> reported
> > if you'd like, though it is pretty rudimentary (for each day, the number
> of
> > times each .apk has been resumed, and the total duration it was resumed).
> > You will need to build your own system to do anything like this though.
> >
> >
> >
> > On Wed, May 13, 2009 at 1:28 PM, clemsongrad  wrote:
> >
> > > To support usability studies on what applications are used, i want to
> > > write a service that logs when an activity is started and also when it
> > > has finished.  This is to understand how the users are using the
> > > device:
> >
> > > One straightforward option is to have the applications modify, to
> > > write this out.  But this is tedious having to modify all applications
> > > and will not work esp with third party or built in applications.
> >
> > > Is there any alternatives that makes this simpler and easier?
> >
> > > BTW: Looking at the android framework source ActivityManagerNative
> > > seems to be invoking a Binder interface when an Activity is started
> > > and finished.  Any information on what this service is?   Is this
> > > something i can tap into?
> >
> > > Apologizes if i am looking at the wrong code, my first foray in to the
> > > framework code.
> >
> > > Any information or thoughts is greatly appreciated.
> >
> > > Thx!
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] dynamically setting drawSelectorOnTop

2009-05-13 Thread damnesia

Is it possible to dynamically set the drawSelectorOnTop attribute on a
Spinner instead of having to do it in the layout XML?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question: How to guestimate the available bitmap memory on a device

2009-05-13 Thread Dianne Hackborn
On Wed, May 13, 2009 at 1:17 PM, Streets Of Boston
wrote:

> According to the heap 'browser' that comes with the ADT plugin in
> Eclipse.
> My app is using less than 4MByte (it's using about 2MByte) but it
> won't allow me to create a bitmap of 12MByte.


I don't think that takes into account bitmaps, which don't exist in the
normal Java heap, but do deduct from its total.


> About max heap usage: Is and will the heap limit be set to 16MByte on
> all devices (i.e. on current devices such as G1, Magic and also on
> possible future android devices)?


Of course at some point in the future, for some set of devices, it will go
up.  It will also of course never go down since that will break lots of
applications.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Framework support for detecting starting and stopping of activities

2009-05-13 Thread Dianne Hackborn
There is nothing in the SDK for this.  In 1.5 there is now some lauch
information maintained by the system, which you can modify to have reported
if you'd like, though it is pretty rudimentary (for each day, the number of
times each .apk has been resumed, and the total duration it was resumed).
You will need to build your own system to do anything like this though.

On Wed, May 13, 2009 at 1:28 PM, clemsongrad  wrote:

>
>
> To support usability studies on what applications are used, i want to
> write a service that logs when an activity is started and also when it
> has finished.  This is to understand how the users are using the
> device:
>
> One straightforward option is to have the applications modify, to
> write this out.  But this is tedious having to modify all applications
> and will not work esp with third party or built in applications.
>
> Is there any alternatives that makes this simpler and easier?
>
> BTW: Looking at the android framework source ActivityManagerNative
> seems to be invoking a Binder interface when an Activity is started
> and finished.  Any information on what this service is?   Is this
> something i can tap into?
>
> Apologizes if i am looking at the wrong code, my first foray in to the
> framework code.
>
> Any information or thoughts is greatly appreciated.
>
> Thx!
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Custom android ANT tasks

2009-05-13 Thread Alexey Volovoy

It'll be nice to have this info here as well
http://developer.android.com/sdk/1.5_r1/upgrading.html#AntUsers

On Apr 14, 2:29 pm, Xavier Ducrohet  wrote:
> Hello,
>
> The new SDK include multiple versions of the Android platforms.
> Because newer versions could have slightly different build steps, we
> have decide to keep most of the build logic inside the platforms
> themselves.
>
> Thus, the new build.xml imports a file called android_rules.xml
> located inside SDK/platforms//templates/ (it might move in
> the final SDK but you shouldn't care much).
>
> This file actually being imported is resolve in the first step of the
> build. The custom task  looks at the value loaded from
> "default.properties" which contains the target project (ie which
> platform/add-on the project is compiling for), and then import the
> proper rules file (after doing some properties init as well).
>
> If you want to change the rules to make them your own, I'd sugges to
> leave android_rules.xml unchanged, and instead copy the rules inside
> your build.xml file, *after* the  task.
> Additionally, change the setup task to . This
> will let the custom task do the properties init but not do the import.
>
> Some of the target in the rules files are slightly different than
> before, with some using custom tasks as well. This is due to a new
> feature to generate multiple APKs from a single project (with
> different resources).
> You can either ignore this and reuse some of the previous target/task,
> or modify the custom task to do what you want (we're pushing the
> source used to generate this SDK on the git server today)
>
> Xav
>
>
>
> On Tue, Apr 14, 2009 at 9:50 AM, Ward Willats  wrote:
>
> > 'Round these parts we don't use Eclipse and heavily customize our
> > build.xml file. The "android" tool tried to update it and burped out
> > a short, confused file.
>
> > That's OK. Don't mind doing build.xml by hand and "target-ifying" it,
> > but I see what look like a whole set of Android-specific ANT
> > tasks/libs (prefs, apkbuilder, jarutil..), of which only  went
> > into the new build.xml.
>
> > So.do I have to include any other custom ANT tasks besides
> > ? Or can I just use more-or-less the same command lines as
> > before with aapt, javac, dx, etc...?
>
> > And what are these "rules" setup uses? And where are they included from?
>
> > Thanks
>
> > -- Ward
>
> --
> Xavier Ducrohet
> Android Engineer, Google.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SDK 1.5: unable to send SMS to another emulator

2009-05-13 Thread lilbyrdie

I couldn't find an open issue for this, so I opened a new one:
http://code.google.com/p/android/issues/detail?id=2660

On May 12, 6:33 pm, lilbyrdie  wrote:
> I also have the same issue where twoemulatorinstances can't call orSMSeach 
> other like they could before (and simulatedSMSor calls to
> them do work -- it's as if the problem is just an outbound one?). Has
> anyone made any progress on this? The documentation implies that it
> should still work, but maybe the feature has been removed? Does it
> work for anyone?
>
> Thanks!
>
> On May 3, 4:02 pm, lior  wrote:
>
> > I am having the same issue on Windows. It used to work before the
> > upgrade to1.5
>
> > On Apr 28, 6:01 pm, zlu  wrote:
>
> > > I'm on Mac OS X.
>
> > > On Apr 28, 4:50 pm, Raphael  wrote:
>
> > > > What operating system do you have? Linux, Mac or Windows?
> > > > R/
>
> > > > On Tue, Apr 28, 2009 at 3:16 AM, ivantipov  wrote:
>
> > > > > Hi,
> > > > > I used to be able to sendSMSmessages from oneemulatorinstance to
> > > > > another; the reason why I didn't use Eclipse is because the app
> > > > > automatically replies to a certainSMSrequest, and the other device
> > > > > is used to receive it.
>
> > > > > That worked fine under SDK 1.1; however, with the upgrade to1.5I get
> > > > > a "could not connect client socket to :::1:5554: Invalid
> > > > > argument" error when trying to send anSMSfrom oneemulatorto
> > > > > another. I've created a separateAVDfor eachemulatorinstance, both
> > > > > Google API, and both devices are listed with the adb devices command.
>
> > > > > Can anyone help?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: java.awt

2009-05-13 Thread bra...@gmail.com

I have very nearly finished porting the java.awt lib to android. I
have skipped all the swing functionality as I cannot see us need ing
it along with some fairly large chunks of the text handling. Graphic
manipulation and IO etc should all still work.

If you are ever given the choice between building your own awt lib and
smacking your face into a wall. Choose the wall. Less painful

On May 12, 1:51 pm, "Mark Murphy"  wrote:
> > By the way - Love your book Mark. The very first android resource I
> > purchased.
>
> Thanks!
>
> --
> 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 Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animated progress in Imageview

2009-05-13 Thread Jeff Sharkey

You're probably looking for AnimatedImageView instead of ImageView,
which will trigger the animation automatically once its visible.
Here's an example in an XML layout:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/layout/status_bar_latest_event_content.xml;hb=cupcake#l15

j

On Wed, May 13, 2009 at 1:29 PM, Al  wrote:
>
> Forgot to mention, the progress indicator is indeterminate, like you
> have in an Activity with Window.FEATURE_INDETERMINATE_PROGRESS.
>
> I've had a look at RotateDrawable, which seems to be the correct thing
> for me to use. The docs say a RotateDrawable should be used with an
> xml that uses . I've tried various methods to get it to
> animate:
>
> img.setImageDrawable(getResources().getDrawable(R.drawable.progress))
> img.setImageDrawable((RotateDrawable) getResources().getDrawable
> (R.drawable.progress))
> and img.setImageDrawable(R.drawable.progress)
>
> All of these bring up a static image. Just to clarify, I think it
> might have been unclear earlier, my ListView row looks like this: |
> [Text           ][Image]| where | is a boundary of a view container.
> The image box can contain various images to indicate the state of
> background activity, a red circle to indicate something wrong, green
> to show nothing unexpected has happened, etc. The indeterminate
> progress (should) show up when the user requests an operation that
> will (possible) take a while to complete.
>
> On May 13, 6:14 pm, Jeff Sharkey  wrote:
>> > ProgressBar widget won't work in this case since the progress
>> > animation is shown depending on background activity associated with
>> > each list row.
>>
>> The widget approach would seem to work--just use
>> android:visibility="gone" until you're ready to show it with
>> setVisibility(View.VISIBLE).
>>
>> --
>> Jeff Sharkey
>> jshar...@android.com
> >
>



-- 
Jeff Sharkey
jshar...@google.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Threading and Message Loops

2009-05-13 Thread radarcg

Thanks to you both for this information, it sounds like its exactly
what I was looking for. It is appreciated, thanks for your
contributions to the community. I'll pay back by posting results...

On May 12, 6:41 pm, Dianne Hackborn  wrote:
> The error means that this Message object has already been posted to a
> queue.  It probably means that somewhere you are keeping  a Message that you
> received from a Handler (the Handler owns the message and will recycle it
> when returning from your code), or otherwise cause a Message to get recycled
> that is also being posted into a Handler.
>
>
>
>
>
> On Tue, May 12, 2009 at 6:04 PM, radarcg  wrote:
>
> > Ok, I'm really struggling with what is likely a simple issue. All I
> > really want to do is have an activity spawn a thread to do a non-
> > trivial action (for now, just testing with sleep(5000) ). Then, when
> > that non-trivial action completes,  the thread should notify the
> > activity, and the activity should present something visual, and
> > proceed. Simple enough right? I'm trying to use a Handler subclass to
> > which I send messages using sendMessage(). That handler subclass with
> > then notify the activity. It all seems to work actually, but then when
> > the thread completes, android is throwing an unhelpful exception:
>
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073): *** Uncaught remote
> > exception!  (Exceptions are not yet supported across processes.)
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):
> > android.util.AndroidRuntimeException: { what=1004 when=4149225
> > arg2=1 } This message is already in use.
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > android.os.MessageQueue.enqueueMessage(MessageQueue.java:173)
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > android.os.Handler.sendMessageAtTime(Handler.java:457)
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > android.os.Handler.sendMessageDelayed(Handler.java:430)
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > android.os.Handler.sendMessage(Handler.java:367)
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > android.view.ViewRoot.windowFocusChanged(ViewRoot.java:2421)
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > android.view.ViewRoot$W.windowFocusChanged(ViewRoot.java:2594)
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at android.view.IWindow
> > $Stub.onTransact(IWindow.java:166)
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > android.os.Binder.execTransact(Binder.java:287)
> > 05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
> > dalvik.system.NativeStart.run(Native Method)
>
> > As a seasoned Java developer, running into trouble like this so early
> > in a new project is frustrating. However, I believe in Android and the
> > broader Google development platforms, so I'd really like to solve
> > this, but I think I need the communities help. Even just some sample
> > code (skeleton apps) that demo some best practices regarding the
> > threading (such as usage of HandlerThread and Looper) would be a big
> > help.
>
> > Thanks,
>
> > Charles
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animated progress in Imageview

2009-05-13 Thread Mark Murphy

> I've had a look at RotateDrawable, which seems to be the correct thing
> for me to use.

I'd vote for RotateAnimation, personally, but that's only because I've
used it for the scenario you're describing.

-- 
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 Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animated progress in Imageview

2009-05-13 Thread Al

Forgot to mention, the progress indicator is indeterminate, like you
have in an Activity with Window.FEATURE_INDETERMINATE_PROGRESS.

I've had a look at RotateDrawable, which seems to be the correct thing
for me to use. The docs say a RotateDrawable should be used with an
xml that uses . I've tried various methods to get it to
animate:

img.setImageDrawable(getResources().getDrawable(R.drawable.progress))
img.setImageDrawable((RotateDrawable) getResources().getDrawable
(R.drawable.progress))
and img.setImageDrawable(R.drawable.progress)

All of these bring up a static image. Just to clarify, I think it
might have been unclear earlier, my ListView row looks like this: |
[Text   ][Image]| where | is a boundary of a view container.
The image box can contain various images to indicate the state of
background activity, a red circle to indicate something wrong, green
to show nothing unexpected has happened, etc. The indeterminate
progress (should) show up when the user requests an operation that
will (possible) take a while to complete.

On May 13, 6:14 pm, Jeff Sharkey  wrote:
> > ProgressBar widget won't work in this case since the progress
> > animation is shown depending on background activity associated with
> > each list row.
>
> The widget approach would seem to work--just use
> android:visibility="gone" until you're ready to show it with
> setVisibility(View.VISIBLE).
>
> --
> Jeff Sharkey
> jshar...@android.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Framework support for detecting starting and stopping of activities

2009-05-13 Thread clemsongrad


To support usability studies on what applications are used, i want to
write a service that logs when an activity is started and also when it
has finished.  This is to understand how the users are using the
device:

One straightforward option is to have the applications modify, to
write this out.  But this is tedious having to modify all applications
and will not work esp with third party or built in applications.

Is there any alternatives that makes this simpler and easier?

BTW: Looking at the android framework source ActivityManagerNative
seems to be invoking a Binder interface when an Activity is started
and finished.  Any information on what this service is?   Is this
something i can tap into?

Apologizes if i am looking at the wrong code, my first foray in to the
framework code.

Any information or thoughts is greatly appreciated.

Thx!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: conversion to dalvik format failed with error 1

2009-05-13 Thread Danny

This seems to work,
but now I'm getting
"Could not find myapp.apk!"

On May 2, 10:05 am, CnmJbm  wrote:
> ok, it seems i fixed it on my environment.
>
> just delete the R.java (by refreshing the project) and rebuild the
> project.
>
> On May 2, 9:57 am, CnmJbm  wrote:
>
> > i got the sameerror, TOO!!!
>
> > May Day
>
> > On Apr 28, 3:57 pm, "chris.cap...@gmail.com" 
> > wrote:
>
> > > Hi,
>
> > > I just updated to SDK 1.5 and all of my projects are failing to build
> > > with the followingerror:
>
> > > [2009-04-28 15:53:23 - Utilities] no classfiles specified
> > > [2009-04-28 15:53:23 - Utilities]ConversiontoDalvikformatfailed
> > > witherror1
>
> > > ("Utilities" is the name of this specific project.)
>
> > > Any idea why? I'm on Ubuntu 9.04 x64. Before the update to 1.5
> > > everything worked fine. Thanks.
>
> > > Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question: How to guestimate the available bitmap memory on a device

2009-05-13 Thread Streets Of Boston

According to the heap 'browser' that comes with the ADT plugin in
Eclipse.
My app is using less than 4MByte (it's using about 2MByte) but it
won't allow me to create a bitmap of 12MByte.

About max heap usage: Is and will the heap limit be set to 16MByte on
all devices (i.e. on current devices such as G1, Magic and also on
possible future android devices)?

On May 13, 2:37 pm, Dianne Hackborn  wrote:
> According to what heap dump?  I am pretty sure that the code just checks to
> see if there is that amount of space left in the java heap, and if not fail
> (otherwise allocate it and tell the VM to account for that as part of its
> heap usage).
>
> On Wed, May 13, 2009 at 11:24 AM, Streets Of Boston 
>
>
>
>
> > wrote:
>
> > Hi Dianne,
>
> > Thanks for your response.
>
> > I know that there is no real thing like bitmap memory.
> > But i also know that when i open a 12MByte bitmap (3MPixel, ARGB_)
> > i *always* get a OOM error. Even if i have more than 12MByte left to
> > work with, according to the heap dump.
>
> > I'm asking if there is a way to 'guesstimate' the amount available
> > that is left for opening (creating) bitmaps.
>
> > On May 13, 2:07 pm, Dianne Hackborn  wrote:
> > > There is no such thing as "bitmap memory" really.  Bitmap allocations are
> > > accounted against your app's overall memory, which is limited to 16MB.
>
> > > On Wed, May 13, 2009 at 10:35 AM, Streets Of Boston <
> > flyingdutc...@gmail.com
>
> > > > wrote:
>
> > > > Hi,
>
> > > > Part of my application allows the user to color-correct images. When i
> > > > open an image for editing, i'd like to know what, more or less, the
> > > > available bitmap memory is for the device that the app is running on.
>
> > > > For the G1, the limit is use is about 6MByte (about a full-size image
> > > > that can be taken by the phone (3MPixels) with 16 bit color ==>
> > > > 6MByte). If i try to open anything larger, i often get an out-of-
> > > > memory exception. Limiting it to 6MByte reduces these OOM exceptions
> > > > by a great deal. However, i can see future devices having more memory
> > > > available because (as one of the reasons) they can take larger pics
> > > > (e.g. 5MPixel or something).
>
> > > > Right now, my app just uses a hard-coded limit of 6*1024*1024. Is
> > > > there a way to make this variable, to future-proof this by examing the
> > > > device my app is running on. If so, how?
>
> > > > Thanks!
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> > and
> > > answer them.- Hide quoted text -
>
> > > - Show quoted text -
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How do I make a ListView scrollbar expand whilst scrolling?

2009-05-13 Thread Dianne Hackborn
Yes this is a new API in 1.5.  If you need to run on older versions, you can
copy the old code out of Contacts before it was integrated into the
framework.  (That's what I did for Rings Extended.)

On Wed, May 13, 2009 at 1:12 PM, Joel Wright  wrote:

>
> Thanks for the help, I've got the scrollbar working how I wanted it
> and I'm working on the SectionIndexer.
>
> I just have one question left.
>
> Does this mean I'm forced to use the Android 1.5 SDK if I want
> fastScrollEnabled? - Trying to build the project at a 1.1 level gives
> me a "no resource identifier found" error on my xml layout.
>
> Thanks again,
> Joel.
>
> On May 13, 8:20 pm, Jeff Sharkey  wrote:
> > Also, to get the A-Z overlay when using fastScrollEnabled, you'll need
> > to implement SectionIndexer for your adapter.  Something like
> > AlphabetIndexer works great if you have a sorted Cursor.
> >
> > http://developer.android.com/reference/android/widget/SectionIndexer
> >
> > j
> >
> >
> >
> > On Wed, May 13, 2009 at 11:42 AM, Dianne Hackborn 
> wrote:
> > > Use this:
> > >http://developer.android.com/reference/android/widget/AbsListView.htm.
> ..
> >
> > > On Wed, May 13, 2009 at 3:39 AM, Joel Wright 
> wrote:
> >
> > >> Hi,
> >
> > >> I'm having a little problem with a ListView scrollbar. The scrollbar
> > >> appears at the side as expected, but how do I get the scrollbar to
> > >> expand and become controllable in the same way it behaves in the
> > >> Contact list? Ideally I'd like all the Contacts list functionality for
> > >> my app - i.e. to allow me to control the scrollbar directly with a
> > >> finger and to show the first letter of the list elements you're
> > >> currently scrolled to.
> >
> > >> Any pointers would be gratefully received,
> > >> Thanks,
> > >> Joel.
> >
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
> >
> > > Note: please don't send private questions to me, as I don't have time
> to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> and
> > > answer them.
> >
> > --
> > Jeff Sharkey
> > jshar...@google.com
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How do I make a ListView scrollbar expand whilst scrolling?

2009-05-13 Thread Joel Wright

Thanks for the help, I've got the scrollbar working how I wanted it
and I'm working on the SectionIndexer.

I just have one question left.

Does this mean I'm forced to use the Android 1.5 SDK if I want
fastScrollEnabled? - Trying to build the project at a 1.1 level gives
me a "no resource identifier found" error on my xml layout.

Thanks again,
Joel.

On May 13, 8:20 pm, Jeff Sharkey  wrote:
> Also, to get the A-Z overlay when using fastScrollEnabled, you'll need
> to implement SectionIndexer for your adapter.  Something like
> AlphabetIndexer works great if you have a sorted Cursor.
>
> http://developer.android.com/reference/android/widget/SectionIndexer
>
> j
>
>
>
> On Wed, May 13, 2009 at 11:42 AM, Dianne Hackborn  wrote:
> > Use this:
> >http://developer.android.com/reference/android/widget/AbsListView.htm...
>
> > On Wed, May 13, 2009 at 3:39 AM, Joel Wright  wrote:
>
> >> Hi,
>
> >> I'm having a little problem with a ListView scrollbar. The scrollbar
> >> appears at the side as expected, but how do I get the scrollbar to
> >> expand and become controllable in the same way it behaves in the
> >> Contact list? Ideally I'd like all the Contacts list functionality for
> >> my app - i.e. to allow me to control the scrollbar directly with a
> >> finger and to show the first letter of the list elements you're
> >> currently scrolled to.
>
> >> Any pointers would be gratefully received,
> >> Thanks,
> >> Joel.
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.
>
> --
> Jeff Sharkey
> jshar...@google.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] read from local socket does not work

2009-05-13 Thread alexdonnini

Hello,

I was wondering if anyone would explain to me why the code snippet
below does not work:

s.getOutputStream().write(length);
s.getOutputStream().write(data);

Log.i(TAG, "data from socket -
"+Integer.toString(s.getInputStream().read()));

In my application, the code is surrounded by try/catch. It does not
generate an exception.

s is an instantiation of LocalSocket.

The code does not work because the attempt to read data from the
socket never completes, i.e. no data is ever returned from the socket
(via the Log.i statement).

I would appreciate it if anyone could help me understand if and where
I made a mistake.

Thanks.

Alex Donnini
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: get Certificates from Package

2009-05-13 Thread friedger

I would assume that the signature is valid, if not the package would
not be installed.

So a hacked Android version could break this assumption. But then the
API to access the public key or even the package file could be hacked
as well

Friedger



On Mar 25, 12:11 pm, Lutz Schönemann
 wrote:
> Well there is a PackageParser class inside the core which reads the  
> Certificates. But there seems to be no interface to get them via the  
> standard API. Do I have to let my app parse the package it self?
>
> Am 23.03.2009 um 18:09 schrieb Lutz Schönemann:
>
>
>
> > Hi,
>
> > I'm looking for a way to get the certificates from a package that are
> > used to sign it. Using the PackageInfo class it is possible to get the
> > signatures. But what can I do with signatures if I don't get the
> > public keys to verify these.
>
> > The next question I have where does the PackageInstaller verify the
> > signed APK file? The PackageParser class loads the APK file into a
> > JarFile object but does this automatically verify the signature?
>
> > Thanks for help
> > Lutz
>
> > >
>
>
>  smime.p7s
> 4KViewDownload

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SQLLite constraint on delete cascade

2009-05-13 Thread Marco Nelissen
It might help if you posted the final string that you're passing to
db.execSQL(), instead of us trying to figure out what the resulting command
is by running the code in our heads.
My guess is that it doesn't work because you're trying to specify a
column-constraint using table-constraint syntax (column constraints don't
use the "FOREIGN KEY" keywords, according to
http://sqlite.org/lang_createtable.html)



On Wed, May 13, 2009 at 1:21 AM, Manu Sánchez wrote:

> Hi!
> I have create a simple DataBase with two tables Notas and Alumno with them
> ids and one attribute each one, Notas is weak and Alumno is the strong
> table, so I want when I delete an Alumno his nota must be delete too:
>
> Translate: Alumno == Student. Notas == Notes
>
> So I use two constraints to do on delete cascade & update like that:
>
> *public* *static* String**
>
> *REFERENCES* = "REFERENCES",
>
> *CONSTRAINT* = "CONSTRAINT",
>
> *FOREIGN_KEY* = "FOREIGN KEY",
>
> *CLAVE_PRIMARIA_GENERICA_TYPE* = "integer primary key autoincrement",
>
> *CREATE_TABLE* = "create table if not exists",
>
> *ESPACIO* = " ";**
>
> *public* *static* *void* creaTablaAlumno (SQLiteDatabase db)
>
> {
>
>   String DATABASE_CREATE = *CREATE_TABLE*+" Alumno (" +
>
>   "ID_alumno "+*CLAVE_PRIMARIA_GENERICA_TYPE*+"," +
>
>   "NombreAlumno text not null"+
>
>   ");";
>
>   db.execSQL (DATABASE_CREATE);
>
> }
>
>
>
> *public* *static* *void* creaTablaNota (SQLiteDatabase db)
>
> {
>
>   String DATABASE_CREATE = *CREATE_TABLE*+" Notas (" +
>
>   "ID_nota "+*CLAVE_PRIMARIA_GENERICA_TYPE*+"," +
>
>   "nota integer not null, " +
>
>   "CD_alumno integer not null," +
>
>   *constraintFK* ("NOTA_ID_nota","CD_alumno","Alumno",
> "ID_alumno")+
>
>   ");";
>
>   db.execSQL (DATABASE_CREATE);
>
> }
>
> *public* *static* String *constraintFK* (String nombreConstraint, String
> columName, String foreignTable, String foreignColumName)
>
> {
>
> String constraint = *CONSTRAINT*+*ESPACIO*+nombreConstraint+*
> ESPACIO*+*FOREIGN_KEY*+" ("+columName+") "+*REFERENCES*+" "+ foreignTable
> +" ("+foreignColumName+") " +
>
> "ON DELETE CASCADE, "+
>
>   *CONSTRAINT*+*ESPACIO*+nombreConstraint+*ESPACIO*+*
> FOREIGN_KEY*+" ("+columName+") "+*REFERENCES*+" "+ foreignTable +" ("
> +foreignColumName+") " + "ON UPDATE CASCADE " ;
>
>*return* constraint;
>
> }
>
> *
> **
> *
>
>
>
> After use that code tables are created but *if I delete an Alumno him nota
> won’t be delete* and I don’t know why. My on delete cascade doesn’t work.
>
> ¿Anyone know how to do Foreign key work in Android?
>
> Thanks! J
>
> (Sorry about my English)
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to debug android source code using eclipse?

2009-05-13 Thread Keith Wiley

Both on the emulator and by USB to a physical device.  Yes.  I can't
remember which documents in the dev guide got me up and running.  Try
this one:

http://developer.android.com/guide/developing/eclipse-adt.html

On May 13, 7:33 am, Nio  wrote:
> Hi ,
> Is there a way to debug Android source code with eclipse?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: what problem is the log.....

2009-05-13 Thread Marco Nelissen
This group is about developing applications using the SDK. You want the
android-porting group.


On Tue, May 12, 2009 at 7:45 PM, dduri  wrote:

>
> hi all...
>
> I testing android-1.5 on virtualbox.
> I compiled x86 porting.
>
> success booting and stop dial app.
>
> what problem??
>
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): Uncaught handler:
> thread main exiting due to uncaught exception
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968):
> java.lang.RuntimeException: Unable to start activity ComponentInfo
> {com.android.contacts/com.android.contacts.DialtactsActivity}:
> android.content.res.Resources$NotFoundException: Resource ID
> #0x7f030005
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2268)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2284)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.os.Looper.loop(Looper.java:123)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.app.ActivityThread.main(ActivityThread.java:3948)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> java.lang.reflect.Method.invoke(Method.java:521)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> (ZygoteInit.java:782)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> dalvik.system.NativeStart.main(Native Method)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): Caused by:
> android.content.res.Resources$NotFoundException: Resource ID
> #0x7f030005
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.content.res.Resources.getValue(Resources.java:846)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.content.res.Resources.loadXmlResourceParser(Resources.java:
> 1796)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.content.res.Resources.getLayout(Resources.java:685)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.view.LayoutInflater.inflate(LayoutInflater.java:318)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.view.LayoutInflater.inflate(LayoutInflater.java:276)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> com.android.internal.policy.impl.MidWindow.setContentView
> (MidWindow.java:230)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.app.Activity.setContentView(Activity.java:1626)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> com.android.contacts.DialtactsActivity.onCreate(DialtactsActivity.java:
> 73)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1123)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2231)
> 05-13 10:00:37.360: ERROR/AndroidRuntime(1968): ... 11 more
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: open socket failed: Permission denied when application to run a native C function.

2009-05-13 Thread Marco Nelissen
Your application needs to request the 'INTERNET' permission in its manifest.


On Tue, May 12, 2009 at 8:03 PM, Terence  wrote:

>
> Hi
>
> I port a tool in native C and builed a executable file or a library,
> and the executable can work successfully in console (Alt + F1).
>
> Then I creat a SimpleJNI to run the executable or library,
> when I click the SimpleJNI icon, it will occure a error message:
> :socket err=Permission denied
>
> Is the user not a root such that can not open socket in native C
> (Permission denied),
> Is there any way to solve this problem ?
>
> Thanks
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How do I make a ListView scrollbar expand whilst scrolling?

2009-05-13 Thread Jeff Sharkey

Also, to get the A-Z overlay when using fastScrollEnabled, you'll need
to implement SectionIndexer for your adapter.  Something like
AlphabetIndexer works great if you have a sorted Cursor.

http://developer.android.com/reference/android/widget/SectionIndexer.html

j

On Wed, May 13, 2009 at 11:42 AM, Dianne Hackborn  wrote:
> Use this:
> http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:fastScrollEnabled
>
> On Wed, May 13, 2009 at 3:39 AM, Joel Wright  wrote:
>>
>> Hi,
>>
>> I'm having a little problem with a ListView scrollbar. The scrollbar
>> appears at the side as expected, but how do I get the scrollbar to
>> expand and become controllable in the same way it behaves in the
>> Contact list? Ideally I'd like all the Contacts list functionality for
>> my app - i.e. to allow me to control the scrollbar directly with a
>> finger and to show the first letter of the list elements you're
>> currently scrolled to.
>>
>> Any pointers would be gratefully received,
>> Thanks,
>> Joel.
>>
>>
>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
>
> >
>



-- 
Jeff Sharkey
jshar...@google.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Stuck in landscape mode after launching YouTube

2009-05-13 Thread Chister Nordvik

Hi!

1. User clicks an image in my app
2. The app launches YouTube
3. Screen is rotated in landscape
4. User presses home button
5. User starts my program again
6. My program is launched with the main screen but it's stuck in
landscape mode (due to Youtube switching orientation)

Nothing I do will make the screen go back "normal" mode again. Is this
a bug? It's only tested on 1.1 device since I can't test YouTube in
the emulator.

If anyone have a 1.5 device out there I would really appreciate if you
could test this for me. Just write me an email :-)

Regards,
Christer Nordvik
www.mobilefootie.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Change View in ListView if selected

2009-05-13 Thread Mark Murphy

>> I'd like to create my ListView and make it's Views be changed while
>> selected (or, clicked). How could I do it?
>
> Detect clicks or selections, and change the appropriate row View.
>
> Could you be more specific in terms of where you need assistance?

At the risk of replying to myself, let me provide a bit more to go on.

ListView supports setOnItemClickListener() and setOnItemSelectListener(),
so you can find out what rows are clicked or selected.

In the case of selected rows, your listener can simply call
getSelectedView() on ListView to get your row View, which you can then
modify.

In the case of a clicked-upon row, it looks to be a bit more difficult. I
cannot seem to find a clearly good way to get the row associated with a
position.

-- 
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 Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Should I use Cursors, or and Object[] to return data from a DB

2009-05-13 Thread Dianne Hackborn
And there are of course other ways to do this -- have a PolygonCursor object
for instance that lets you iterate over the cursor and provides an API to
get the polygon data for the current position.

On Wed, May 13, 2009 at 11:40 AM, Mark Murphy wrote:

>
> > Please bear in mind that you are writing applications to run on mobile
> > devices whose horsepower is reminiscent of PCs from a decade ago.
> >
> > Programming techniques that you might use on a current PC with tons of
> > RAM, fast CPUs, and access to constant AC power are not necessarily
> > recommended in a mobile device environment.
>
> At the risk of replying to myself, let me clarify.
>
> Creating more garbage to gain cleaner APIs is a trade-off. Created garbage
> may affect your application, and it may affect other applications -- we've
> had complaints on this list already from game developers who cannot
> maintain consistent frame rates because of garbage collection in other
> applications.
>
> Similarly, adding extra VM instructions, to create DatabasePolygon objects
> and pull data out of Cursors, chews up battery life.
>
> You did not indicate whether you database will have one or 10,000
> polygons. The magnitude of the extra garbage and instructions will be tied
> to the number of polygons you create.
>
> So, while I agree with you that dealing with Polygon objects may be tons
> cleaner than dealing with Cursors, bear in mind there is a cost involved,
> and be sure to weigh that cost when deciding what to do.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 2.0 Available!
>
>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How do I make a ListView scrollbar expand whilst scrolling?

2009-05-13 Thread Dianne Hackborn
Use this:
http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:fastScrollEnabled

On Wed, May 13, 2009 at 3:39 AM, Joel Wright  wrote:

>
> Hi,
>
> I'm having a little problem with a ListView scrollbar. The scrollbar
> appears at the side as expected, but how do I get the scrollbar to
> expand and become controllable in the same way it behaves in the
> Contact list? Ideally I'd like all the Contacts list functionality for
> my app - i.e. to allow me to control the scrollbar directly with a
> finger and to show the first letter of the list elements you're
> currently scrolled to.
>
> Any pointers would be gratefully received,
> Thanks,
> Joel.
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Should I use Cursors, or and Object[] to return data from a DB

2009-05-13 Thread Mark Murphy

> Please bear in mind that you are writing applications to run on mobile
> devices whose horsepower is reminiscent of PCs from a decade ago.
>
> Programming techniques that you might use on a current PC with tons of
> RAM, fast CPUs, and access to constant AC power are not necessarily
> recommended in a mobile device environment.

At the risk of replying to myself, let me clarify.

Creating more garbage to gain cleaner APIs is a trade-off. Created garbage
may affect your application, and it may affect other applications -- we've
had complaints on this list already from game developers who cannot
maintain consistent frame rates because of garbage collection in other
applications.

Similarly, adding extra VM instructions, to create DatabasePolygon objects
and pull data out of Cursors, chews up battery life.

You did not indicate whether you database will have one or 10,000
polygons. The magnitude of the extra garbage and instructions will be tied
to the number of polygons you create.

So, while I agree with you that dealing with Polygon objects may be tons
cleaner than dealing with Cursors, bear in mind there is a cost involved,
and be sure to weigh that cost when deciding what to do.

-- 
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 Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question: How to guestimate the available bitmap memory on a device

2009-05-13 Thread Dianne Hackborn
According to what heap dump?  I am pretty sure that the code just checks to
see if there is that amount of space left in the java heap, and if not fail
(otherwise allocate it and tell the VM to account for that as part of its
heap usage).

On Wed, May 13, 2009 at 11:24 AM, Streets Of Boston  wrote:

>
> Hi Dianne,
>
> Thanks for your response.
>
> I know that there is no real thing like bitmap memory.
> But i also know that when i open a 12MByte bitmap (3MPixel, ARGB_)
> i *always* get a OOM error. Even if i have more than 12MByte left to
> work with, according to the heap dump.
>
> I'm asking if there is a way to 'guesstimate' the amount available
> that is left for opening (creating) bitmaps.
>
> On May 13, 2:07 pm, Dianne Hackborn  wrote:
> > There is no such thing as "bitmap memory" really.  Bitmap allocations are
> > accounted against your app's overall memory, which is limited to 16MB.
> >
> > On Wed, May 13, 2009 at 10:35 AM, Streets Of Boston <
> flyingdutc...@gmail.com
> >
> >
> >
> >
> >
> > > wrote:
> >
> > > Hi,
> >
> > > Part of my application allows the user to color-correct images. When i
> > > open an image for editing, i'd like to know what, more or less, the
> > > available bitmap memory is for the device that the app is running on.
> >
> > > For the G1, the limit is use is about 6MByte (about a full-size image
> > > that can be taken by the phone (3MPixels) with 16 bit color ==>
> > > 6MByte). If i try to open anything larger, i often get an out-of-
> > > memory exception. Limiting it to 6MByte reduces these OOM exceptions
> > > by a great deal. However, i can see future devices having more memory
> > > available because (as one of the reasons) they can take larger pics
> > > (e.g. 5MPixel or something).
> >
> > > Right now, my app just uses a hard-coded limit of 6*1024*1024. Is
> > > there a way to make this variable, to future-proof this by examing the
> > > device my app is running on. If so, how?
> >
> > > Thanks!
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.- Hide quoted text -
> >
> > - Show quoted text -
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Dev Phone 1 activation Problem

2009-05-13 Thread devi prasad

Hi, I'm also facing a similar problem with Airtel SIM in India.I get
the following error message:

"There is a problem communicating with the Google Servers;

This could be a temporary problem. Your SIM card may not be
provisioned for data services. If it continues, call customer care."

Any help and suggestions are welcome
thanks


On Fri, May 1, 2009 at 8:40 PM, Shre555  wrote:
>
> Hi  I  got my Android Dev Phone 1 Yesterday.
>
> I tried to enter my gmail account info but it always gives me the
> error
>
> I stay in India
>
> I used Airtel
>
> with APN settings Name:airtelgprs.com
>
> APN: airtelgprs.com
>
> when I enter the info and press the sign in button the adb logcat
> says
>
> NETWORK ERROR
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Gallery usage without using styleable

2009-05-13 Thread lilbyrdie

I've answered my own question. Net result is the same, just a
different way of getting to the default theme resources, but it's what
I was missing.

Within your attrs.xml file, place a block that looks like the
following:





This basically provides access to the galleryItemBackground in the
same way as before, but explicitly making it a styleable now.

This is now used as before:

Within the ImageUriAdapter(), load the background:
TypedArray a = 
obtainStyledAttributes(R.styleable.default_gallery);
mGalleryItemBackground = a.getResourceId(

R.styleable.default_gallery_android_galleryItemBackground, 0);
a.recycle();

Then, within the getView(), apply the background:

imageView.setBackgroundResource(mGalleryItemBackground);

I hope this helps someone.


On May 12, 12:43 pm, lilbyrdie  wrote:
> Hello,
>
> I'm trying to find the "correct" new way to do image Gallery items,
> previously (as also documented 
> here:http://developer.android.com/guide/tutorials/views/hello-gallery.html
> and herehttp://developer.android.com/reference/android/widget/Gallery.html)
> the correct way was to apply
> android.R.styleable.Theme_galleryItemBackground.
>
> Of course, this has been removed (see 
> here:http://groups.google.com/group/android-developers/browse_thread/threa...)
> even though the Gallery assumes it will be used (see above Gallery
> documentation).
>
> The net effect is that, without this, a gallery with images looks
> pretty bad. I could copy out all of the values and resources to
> recreate the default look, or use reflection to get at styleable, but
> none of that seems like a particularly workable solution.
>
> Thoughts? What am I missing?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question on ContentProviders

2009-05-13 Thread Jonathan Herriott

Thanks Dianne.  That helps alot.  The reason I asked is because my
ContentProvider will allow other applications to insert into it,
similar to a logging system.  Since I can't guarantee an application
won't try to abuse it, I was just trying to figure out what type of
safeguards to put into it.

I'm very interested in exploring the responsiveness of the UI to large
cursors.

On May 12, 6:47 pm, Dianne Hackborn  wrote:
> The storage is very compact, but you definitely want to limit the result set
> as much as possible especially if there are a lot of results.  Note that at
> the end of the day, SQLite will generate a complete result set of the query,
> so whether it is windowed or not doesn't really save the amount of peak
> memory.  If you are seriously contemplating having results of 100K items,
> you absolutely need to do some up-front prototyping on real hardware to see
> how it will be handled, not just for memory but also the time to do the
> query.  I also have to wonder how someone is actually going to be able to do
> any kind of reasonable navigation of that many items in the UI (and relying
> on filtering is kind-of questionable because I can't imagine the results
> being returned quickly enough to make UI response from filtering all that
> pleasant).
>
> But who knows, you'll just need to try it out.
>
> As far as memory accounting, this memory is shared between the processes, so
> it should be accounted to both of them.
>
> On Tue, May 12, 2009 at 6:35 PM, Jonathan Herriott wrote:
>
>
>
>
>
>
>
> > So, I'm guessing I need to limit the number of rows that can exist in
> > a ContentProvider, so as to avoid memory issues if per some strange
> > chance the provider has a ridiculous number of rows.  I'm actually
> > going to go and test to see if there is any significant change in the
> > amount of application memory usage between a query of only a couple
> > items, and a query of, say, 100K from the perspective of the client.
> > I honestly don't know which user/application the shared memory is
> > associated with, so who gets hit with having to store the result set
> > in their heap?  Maybe I'm over thinking this and I shouldn't worry?
>
> > On May 12, 1:43 pm, Dianne Hackborn  wrote:
> > > Actually I am mistaken -- we haven't done windowing for a long time
> > > apparently. :)  So the result of the query is generated into a shared
> > memory
> > > in total that the client can read.
>
> > > On Tue, May 12, 2009 at 1:34 PM, Jonathan Herriott  > >wrote:
>
> > > > Hi Dianne,
>
> > > > That essentially answers my question.  I was curious as to what
> > > > happens when you query, say, a database that contains 100K rows, how
> > > > it effects memory.  From what you said, I'm assuming that it stores a
> > > > subset in shared memory, and when the window moves, the subset
> > > > changes, thereby eliminating any worry about running out of memory for
> > > > large queries.
>
> > > > I guess my issue is that I'm having a difficult time tracking what
> > > > objects are being supplied for interfaces (IContentProvider, etc.).
> > > > Does there happen to be a resource file which shows which objects are
> > > > being used, or do I just need to spend more time studying the code?
>
> > > > Thanks,
> > > > Jonathan Herriott
>
> > > > On May 11, 5:50 pm, Dianne Hackborn  wrote:
> > > > > Not sure what you mean.  The content provider runs in its own
> > process.
> > > >  When
> > > > > you do a query, the results are windowed in shared memory for access
> > by
> > > > your
> > > > > process.
>
> > > > > On Mon, May 11, 2009 at 3:39 PM, Jonathan Herriott <
> > herri...@gmail.com
> > > > >wrote:
>
> > > > > > I was diving through the Android code on how ContentProviders work,
> > > > > > and to me, it looks like any ContentProvider I query actually gets
> > > > > > placed entirely in the memory of the requesting application.  Are
> > they
> > > > > > really stored in the querying application's memory?  For some
> > reason I
> > > > > > thought the cursors were lazy.
>
> > > > > --
> > > > > Dianne Hackborn
> > > > > Android framework engineer
> > > > > hack...@android.com
>
> > > > > Note: please don't send private questions to me, as I don't have time
> > to
> > > > > provide private support, and so won't reply to such e-mails.  All
> > such
> > > > > questions should be posted on public forums, where I and others can
> > see
> > > > and
> > > > > answer them.
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> > and
> > > answer them.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-

[android-developers] List items not clickable when using ListAdapter, but clickable with SimpleAdapter

2009-05-13 Thread brian.schim...@googlemail.com

Hi,

I was populating a list with a SimpleAdapter like this:

final List> data = someObject.getData();
SimpleAdapter dataAdapter = new SimpleAdapter
(this, data, R.layout.listline, from, to);
listView.setAdapter(dataAdapter);
listView.setOnItemClickListener(...);

The listView gets this from the layout.xml:
android:choiceMode="singleChoice" android:clickable="true"

R.layout.listline defines a layout for each line, having 4 TextViews
and some more widgets. Everything works fine so far.

But now I need to use a ListAdapter to populate my list. It was easy
to write a class that implements all those methods required by that
interface, and the resulting List looks exactly the same now. It
performs well on scrolling, changing data, etc. but the lines are not
clickable any more. My onItemClickListener.onClick is never called,
not matter where I tap on my list line (e.g. on one of the TextViews
or on the background of that line). In my implementation, I use
View.inflate to inflate excactly the same xml as the SimpleAdapter
did.

Shouldn't the click behaviour of a list be independant of where data
comes from?

I guess SimpleAdapter does some internal "magic" that I'd need to
perform in my own implementation as well, to make the line clickable.
Can somebody point out what I'm missing? I'd also like to look at the
source code of SimpleAdapter, but I coudn't find it anywhere on
http://android.git.kernel.org/ - maybe I'm just to dumb to look in the
right place. Can somebody point me to that code? (possibly without
forcing me to install git and download the whole code base)

thanks,
Brian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



  1   2   3   >