[android-developers] try to see hprof dump from ddms

2010-02-04 Thread allstars
hello world
i try to see hprof from ddms

but i find out
if my app(a simple HelloWorld) is built by mydroid (i.e. using
Android.mk)
it always complains permission denied

but if my app is built by SDK ( ant )
it can show hprof

so i would like to ask what's the difference here and
what should i do if i want to see hprof when my app is built
in mydroid


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: Help needed with parsing some XML data !

2010-02-04 Thread MobDev
hehe,
my bad I said Netbeans but I actually use Eclipse :P
Still used to J2ME with NetBeans thats why I mixed up...
Anyways, I do get the error (exception) which I already posted in one
of my first posts :
At line 40, column 23: not well-formed (invalid token)

They *MUST* be valid printing Unicode
characters. No random control characters -- for example, ISO-8859-1
byte values 0-31 (decimal). This will ALWAYS fail -- it is NOT well-
formed XML. If that's the cause of your exceptions
Well I did paste the error-generating xml entry which for example is :
Country ID=2 CName=Åland eilanden/


It would help
if you posted the URL to the XML 
Unfortunately I am not allowed to do so :( It's a URL which is
actually in use by our already exisiting software...

Also I noticed my previous post was posted three times ! My apologies
for that, I actually can't remember pushing the Send button three
times :P

On 3 feb, 19:02, Bob Kerns r...@acm.org wrote:
 Yeah, that's not what I mean by a test case.

 Seehttp://junit.orgas a starting point.
 (The Android SDK includes some limited version of JUnit I don't
 recognize. It's adequate for this purpose, but the full, modern
 version is better. For non-device testing, you're not restricted to
 the supplied one.)

 Basically, a test case is code that you can run to *automatically*
 test some specific aspect of a system. In this case, checking against
 a known set of XML (so it doesn't change), looking for the known
 desired result, and reporting failures (expected conditions not
 matching) and errors (unexpected exceptions thrown).

 This removes the variables from the equation. You're not depending on
 how things display, either in the UI nor in the log stream and
 windows. You're not dependent on a human to notice a problem.

 An best of all, you can automate it to always run when you build, so
 if you break later, you'll find out right away, while you know what
 you changed. And you can make changes freely, with the security of
 knowing that you won't have to go through some long test/debug cycle.

 I didn't answer your question about getting a stacktrace earlier,
 because you said NetBeans. I'm old enough to remember when NetBeans
 was the hot new thing -- but too old to remember how to do anything
 with it. Try using Eclipse and the ADK. It will show you the stack
 trace in the same way it shows any other stack trace, as if you were
 debugging locally. (I would expect NetBeans to, as well).

 Or you can catch the exception, and use exception.printStackTrace() to
 get it into the log (I'm surprised it's not already there).

 This isn't really an Android problem, and it's not necessary to debug
 it there. If you write your failing test cases, you can debug them on
 your desktop computer, get them working, and you should be set to go
 on the device.

 Another thing to realize is that not all character values you can come
 up with, are legal XML content. They *MUST* be valid printing Unicode
 characters. No random control characters -- for example, ISO-8859-1
 byte values 0-31 (decimal). This will ALWAYS fail -- it is NOT well-
 formed XML. If that's the cause of your exceptions, your two choices
 would be to fix it on the server (probably by encoding this binary
 data) or to preprocess the fake-XML into real XML before you feed it
 to the XML parser.

 \
 On Feb 3, 6:49 am, MobDev developm...@mobilaria.com wrote:

  well to begin with : thx for the expalanation :D
  I was wondering about your statement :
  Try logging to a file. Or better yet, create test cases, and verify
  the correct operation of your code via test suite, rather than via log
  statements. 
  I already tried in a test case, which was to write the incoming data
  to a AlertDialog, but the result was that those characters are shwon
  on-screen with a rectangle with a ? in it... My idea (and test case)
  would be to stream a list of countries, and afterwards show this
  list onscreen so the user can select one...
  Our problem is that the whole system I am using is based on the ISO
  norm and cannot be changed to UTF-8 in a short period of time...
  Or am I misinterpreting your test cases and test suite ? And if so
  how should it have been interpreted ?

  On 3 feb, 13:26, Bob Kerns r...@acm.org wrote:

   Well, you found one way to get the encoding in there. A few more:

   InputSource.setEncoding(iso-8859-1)
   new InputStreamReader(stream, iso-8859-1);

   I'd argue that it should have gotten it from the ?xml...
   encoding=iso-8859-1? -- I'm a bit surprised it didn't. But it's
   something I'd never rely on if I know the encoding.

   Anyway, re: your problem below. It's probably working right, up to the
   point of the log statement.

   The log stream is probably taking those bytes, and then later they're
   being interpreted as UTF-8. or it's taking the characters from the
   string, and interpreting them as UTF-8 (via String.getBytes()) and
   passing them off to a log stream that doesn't know about 

[android-developers] Re: Is passing AMR_NB into AudioTrack and AudioRecord valid?

2010-02-04 Thread Donal Rafferty
Anyone?

On Wed, Feb 3, 2010 at 5:24 PM, draf...@gmail.com draf...@gmail.com wrote:

 I currently use AudioTrack and AudioRecord to create a looping sound
 program and I was using raw PCM audio but I want to use AMR_NB audio
 so I set up the code as follows

 arec = new AudioRecord(MediaRecorder.AudioSource.MIC,
   11025,

 AudioFormat.CHANNEL_CONFIGURATION_MONO,

 MediaRecorder.AudioEncoder.AMR_NB,
   buffersize);
 atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL,
   11025,

 AudioFormat.CHANNEL_CONFIGURATION_MONO,

 MediaRecorder.AudioEncoder.AMR_NB,
   buffersize,

 AudioTrack.MODE_STREAM);

 The above code works fine but is passing
 MediaRecorder.AudioEncoder.AMR_NB in as the Audio Format valid or is
 it working but actually not being encoded as AMR_NB?



-- 
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 use com.android.internal.telephony

2010-02-04 Thread saru
hey i need to use com.android.internal.telephony package for my
development. but i am in a doubt whether i would use
android.internal.telephony package or how

Please tell me about it?

-- 
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: anyone meet anonymous mms/sms?

2010-02-04 Thread Andrew Ding


 Can erveryone who know the detail root cause share your
brightness to me? Thank you in advance!  :(



On Feb 4, 3:45 pm, Andrew Ding dingwei...@gmail.com wrote:
        Thank you very much. But can you tell me the root cause so that
 I can fix it in our product?

        Our product is based on cupcake1.5 and we do not want to
 upmerge to Eclair.

 BR,
 Andrew

 On Feb 4, 3:30 pm, Anonymous Anonymous firewallbr...@googlemail.com
 wrote:



  This is fixed/changed flow in Eclair.

  On Thu, Feb 4, 2010 at 12:56 PM, Andrew Ding dingwei...@gmail.com wrote:
   Hi, all,

        We sometimes receive mms/sms whose from field is anonymous.
   After check the mmssms.db, all the fields are correct. If it shows
   anonymous, only after we power cycle radio can it be recovered with
   correct sender name. Our platform is cupcake1.5. The issue is not easy
   to reproduce but happens often. When issue happens, I exit from
   Message App and launch it again, the issue still exists. slect that
   message and longclick at it and view its detail info, we can find that
   the from and to fields all all empty. The screen shows that the from
   is hidden sender. From the code and db, we know PDU_CACHE_INSTANCE
   is not correct but DB is correct. Does anyone the issue and the root
   cause? Thank you very much.

   BR,
   Andrew

   --
   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.comandroid-developers%2bunsubs­­cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en-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: Problem running TCPDUMP on Android Device..

2010-02-04 Thread Alok Kulkarni
Got the solution.Need to get the device rooted.
Thanks,
Alok.

On Thu, Feb 4, 2010 at 12:44 PM, Alok Kulkarni kulsu...@gmail.com wrote:

 Hi, I am trying to install the tcp dump on my purchaced device.When i try
 to do adb push tcpdump /system/bin it says read only file system.So it seems
 that i cant do it. This was verified when i did follow
 http://pdk.android.com/online-pdk/guide/tcpdump.html and ran the command
 “adb root” . It gave me a message “adbd cannot run as root in production
 builds”. Is there any way to run the tcp dump on my device ?
 Thanks,
 Alok.


-- 
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: sticky client IP address?

2010-02-04 Thread Mike
Hi,

My answer wasn't incorrect... you are simply misunderstanding what
end-to-end means in this context.  This is getting a bit off topic,
but it's interesting stuff.

TCP/IP begins and ends at the edge of the cell network, on the network
providers Internet gateway.  Between the gateway and the phone itself
there is no TCP/IP.  This is the exact reason why you CANNOT build TCP/
IP connections from a server to a phone.  You can ONLY build
connections from a phone to a server.

For further clarification see 
http://en.wikipedia.org/wiki/Packet_Data_Protocol#PDP_Context

When the gateway receives the outgoing request from the phone, the
gateway assigns its own IP address and a port number to the request
and puts it on to the Internet as a standard TCP/IP data packet.  This
context may exist for some time on the gateway, or it may be flushed
very quickly, there is no way to predict.  It's not even possible for
the application on the phone to know what IP address is being used on
its behalf.

The packet coming back to the phone is stripped of its TCP/IP envelope
at the gateway and then put on the cell network using whatever packet
technology the cell network uses.  This is the very meaning of the
word gateway... it is a gateway between two completely different
networks that work in completely different ways, it is a protocol
converter.

- Mike
NAVTEQ Network for Developers
http://NN4D.com

Disclaimer: I work for NAVTEQ and these are my personal opinions which
do not necessarily reflect NAVTEQ’s views

On 4 Feb, 07:13, Bob Kerns r...@acm.org wrote:
 This isn't correct, or is misleading. It's kind of like saying
 ethernet doesn't use TCP/IP or WiFi doesn't use TCP/IP or dialup
 modems don't use TCP/IP or DSL doesn't use TCP/IP or Cable doesn't
 use TCP/IP.

 If you drop below the level of TCP/IP, to how the data is physically
 moved, then yes, you are below TCP/IP, and in that sense, cell
 networks don't use TCP/IP.

 However, they CARRY TCP/IPtraffic. And that's what thoseIPaddresses
 are --IPaddresses. You can establish TCP connections.

 TCP/IPis actually two protocols.IPis the lower-level of the two,
 handling addressing and routing. It is completely agnostic as to how
 the packets are transported. You could use carrier pigeons. Really!

 http://www.rfc-editor.org/rfc/rfc1149.txt

 I don't know if anybody's done it -- but it wouldn't surprise me.

 TCP is on top ofIP, and gives you reliable transmission and end-to-
 end connection semantics.

 Now, perhaps you meant to contrast the situation with VOIP, where
 voice is carried overIP. Indeed, voice data is not (normally) carried
 over cell networks as TCP/IP, though it's possible. (Not necessarily
 acceptable, but possible).

 But every phone with a data plan is using the cell networks to carry
 TCP/IP.

 Your gatewayaddresswill be theaddressof the gateway server, but
 yourIPaddresswill be yourIPaddressthat your server uses to send
 traffic to you.

 I don't know the current state of the art for how stable your 
 phone'sIPaddresswill be. I can tell you that my phone switches cell sites
 surprisingly often, but I've not watched theIPaddresses
 simultaneously.

 But you don't switchIPaddresses when you move from Access Point to
 Access Point on the same WiFi network. In theory, you could retain the
 sameIPaddressfor the life of your phone, with a sufficiently clever
 and powerful cell network.

 In practice, however, that's unreasonable. But perhaps someone can
 tell me just when it changes. And why, after rebooting, I have TWO?
 One for each tower? We're at the limits of my networking knowledge
 when we come to the specifics of how it's layered on top of the
 cellular network.

 BTW, Vertifi, this Class B/Class C terminology is long obsolete;
 addresses have not been allocated by that scheme for many years. It
 consumed too much IPv4addressspace. Instead, the number of prefix
 bits is specified, like 192.168.0.0/24 -- where 24 is not necessarily
 a multiple of 8. I don't know if your server farm people are expecting
 Class C to refer to distinct networks, or simply using the term as a
 holdover, but treating it as the arbitrary distinction that it is. But
 certainly we should not import any significance to thoseIPaddresses
 being allocated from some larger block than /24. They could all be
 from the same subnet, so far as the cellular network is concerned.
 This would be some network in some bunker somewhere, with a bunch of
 NAT servers, with multiple hot connections to various pieces of the
 backbone.

 TheIPaddressassigned to the phone will be anaddressspecific to
 the link between you and the next piece of equipment that actually
 treats your data as TCP/IPtraffic. My iPhone reports it as
 10.135.130.117; I've never seen it other than a 10.0.0.0/8 non-
 routable privateaddress. This is translated via NAT further upstream,
 so servers on the other end see a routableIPaddress; at the moment,
 mine is 98.210.255.162.

 In theory, this can be different for 

[android-developers] Re: Gallery positioning first item

2010-02-04 Thread Andr dev
Well, so far my solution is to rewrite the full Gallery class, with an
only change like :

private int getCenterOfGallery() {
 return 40; // Or whatever you want.
}


... surely not the best way to do it ;-) !


Regards,
G.



On Feb 3, 4:55 pm, Andr dev dev.android.al...@gmail.com wrote:
 Hello all,

 This one is quite simple, or should be, but I couldn't figure out how
 to.
 So ...

 I have a Gallery, something like :
 Gallery android:id=@+id/Gallery01
 android:layout_width=fill_parent
 android:layout_height=wrap_content android:spacing=0sp/Gallery

 Inside, custom views : first item has a width of 200px, all other
 items have a width of 150px.

 Now, in landscape mode, with a screen of -let's say- 800px :
 - by default the first item is selected;
 - by default the selected item is positioned in a slot so that its
 center is the gallery's center;
 - so, when first loading the gallery, the layout is :
   * 300 px that are empty
   * 200 px with first item
   * 2 * 150px with second and third items.
   * = Total of 800px

 Now, the behavior I try to reach is to have the first item taking the
 empty space at its left, to have the following layout :
  * 200 px with first item
  * 4 * 150px with items 2, 3, 4  5
  * = Total of 800px

 I tried :
 - scrollx on gallery : it moves the whole view to the left, NOK
 - padding : NOK
 - margin : NOK
 ...

 Any idea ?

 Thanks  regards,
 G

-- 
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 create executable file with linking static library?

2010-02-04 Thread bluestar
Dear Sir:

 I have a static library: libhello.a and I want to create a
executable file that link with this
 static library: libhello.a

 I put this static library under
 /out/target/product/generic/obj/STATIC_LIBRARIES/
libhello_intermediates/
 and make my executable file, but failed

 It shows error message:
 make: *** No rule to make target `NOTICE-TARGET-STATIC_LIBRARIES-
libhello'.  Stop.

 How to fix this issue? (Below is Android.mk of executable file)
 Thanks!!!

//-//
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
LOCAL_SRC_FILES:= MyMain.c
LOCAL_SHARED_LIBRARIES := libcutils libc
LOCAL_STATIC_LIBRARIES := libhello
LOCAL_MODULE := myhello
include $(BUILD_EXECUTABLE)
//-//


BR,
Alan

-- 
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: Canvas drawing

2010-02-04 Thread Neilz
Well, it would appear that all these extra calls to onDraw() are
because my base Activity extends MapActivity.

Just having a MapView seems to be causing this, even though nothing in
the view actually requires updating. I don't suppose there's anything
I can do about that?

-- 
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] Resizing video on the Nexus One turns surface white

2010-02-04 Thread Kirwan Lyster
In order to offer embedded or fullscreen video, I attach the
MediaPlayer to a SurfaceView which is inside a LinearLayout and then
change the parent's padding values to reposition and resize the video.

This works on all devices except the Nexus One.

On the Nexus One, as soon as the surface size changes it goes white so
the audio continues but the video is lost. Each time the surface is
resized, it's possible to see a single frame before it goes white
again.

Does anyone know if this is a bug or is there an alternative way to go
to full screen?

I do already call
SurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS),
without which the surface remains black throughout.

As a workaround, I'm trying to launch a separate activity with a
separate layout and pass the player through, but at the moment that's
not working either. Should that be possible or can a MediaPlayer not
be re-assigned to a new SurfaceView once it's started?

Cheers,
Kirwan

-- 
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] need soap 1.2 example

2010-02-04 Thread Shrenik Vikam
can i get the example of soap 1.2 client implemented  ?

-- 
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


Re: [android-developers] Re: Help needed with parsing some XML data !

2010-02-04 Thread Frank Weiss
I have two ideas for you, Mobdev:

1) Google for not well-formed (invalid token) and see what other people
have found regarding this error.
2) Go to validator.w3.org and see if the XML file in question is indeed
valid or not.

Please let us know what you find out.

-- 
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] CHEEK_EVENT flag

2010-02-04 Thread rahul
Hi All,

I am working on an application which should not receive CHEEK_EVENT.
Currently Phone app is using the flag to suppress the cheek events in
the IncallScreen.java by setting the flag for the window using
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES).
and i also saw that in the target window flag is checked with the
FLAG_IGNORE_CHEEK_PRESSES and then events are changed to
ACTION_CANCEL and sent to application. In order to disable cheek
events in my application should i also just add the flag by using
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES)
in one of the activity and when the activity is active then the cheek
events will be ignored ? Please help in clarifying this doubt.

Thanks in advance
Rahul

-- 
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


Re: [android-developers] how to use com.android.internal.telephony

2010-02-04 Thread haric zhu
Hi, you can copy some classes for android.internal.telephony into you own
project, will be OK in using.

2010/2/4 saru sarucs...@gmail.com

 hey i need to use com.android.internal.telephony package for my
 development. but i am in a doubt whether i would use
 android.internal.telephony package or how

 Please tell me about it?

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Best Regards

Haric

-- 
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: Move the virtual keyboard to the top of the screen (SIP - IME)

2010-02-04 Thread flsobral
Still stuck with this problem.
Any tips?


On Feb 2, 12:02 pm, flsobral flsob...@gmail.com wrote:
 It would also be helpful to make the virtual keyboard always be shown
 in fullscreen.
 I tried to extend the class InputMethodService overriding
 onEvaluateFullscreenMode to always return true, but I had the
 following problems:
 - My application UI is still shown above the keyboard, even after
 setting the attribute android:imeFullscreenBackground.
 - Selecting another control other than the one that activated the
 keyboard makes the application hang.
 - Couldn't find a way to show the keyboard with the Done button
 instead of enter.

 On Feb 2, 9:16 am, flsobral flsob...@gmail.com wrote:



  Hello.

  I'm looking for a way to move the virtual keyboard to the top of the
  screen, rather than the bottom. Is it possible?

  Thanks in advance.

  Fabio.

-- 
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: White Paper - Sony Ericsson Vivaz, the HD ready phone

2010-02-04 Thread Carl Whalley
This double post to a broken link is about a Symbian handset.

On Feb 4, 6:30 am, SonyEricsson DeveloperWorld
sonyericssondeveloperwo...@gmail.com wrote:
 Vivaz has a 3.2 inch 360 x 640 pixel TFT resistive touchscreen with 16
 million color depth. OpenGL ES 1.1 and 2.0 are supported for superb
 graphics.
 The 8.1 megapixel camera has 4x digital zoom and Sony Ericsson’s face
 and smile detection features. Connectivity includes Wi-Fi 802.11g and
 HSPA at 7.2Mbps download; naturally we include seamless integration
 with Facebook™ and Twitter.

 Complete specifications and details can be downloaded fromhttp://bit.ly/doGGiA

-- 
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] Query related to adding a new flag in the WindowManager (Similar to FLAG_IGNORE_CHEEK_PRESSES)

2010-02-04 Thread rahul
Hi All,

I am working on an adding a FLAG similar to FLAG_IGNORE_CHEEK_PRESSES.
I have added an entry in the WindowManager.java for my flag and in the
Phone application activity incallscreen.java i have added this flag
along with FLAG_IGNORE_CHEEK_PRESSES using
getWindow().addFlags(WindowManager.LayoutParams.MY_FLAG_ENTRY). Also
in the dispatchPointer method of WindowManagerService.java i am
checking for this current window flag along with
FLAG_IGNORE_CHEEK_PRESSES.

I have following queries:
1. Is this only i need to do to create a new flag and application can
then register for this one ?
2. Also i commented the statement
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES)
in the InCallScreen.java but still i could see that the condition
if ((target.mAttrs.flags 
 
WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES) != 0) {
being satisfied. Can someone let me about this?

Thanks in advance
Rahul

-- 
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 load XML files dynamically

2010-02-04 Thread Shekhar
Hi Folks,

I need help on how to load XML  file dynamically in the code.I have an
activity and for the activity I have 5 xml layout files.I want to load
one of the XML file depending on the some logical condition.for e.g

switch(i)
{
case 1:
//load XML file 1
break;
case 2:
//load XML file 2
break;
case 3:
//load XML file 3
break;

}

Please help me with some code snippet as i am new to the android
Programming.

Thanks,
Shekhar

-- 
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: XmlPullParserException: expected: START_TAG

2010-02-04 Thread Shrenik Vikam
how to get the xpp object ?

On Feb 4, 3:29 am, Nicholas Albion nalb...@gmail.com wrote:
 If you determine that the problem is that the XML (or HTML!) is badly
 formatted and you have no control over it, you can do something like:

 int n;
 while( (n = xpp.getNext()) != END_DOCUMENT ) {
   try {
      // do your parsing element-by-element
   } catch( org.xmlpull.v1.XmlPullParserException e ) {} // ignore the
 exception
   } catch( Throwable e ) {
      log.warning(error while parsing file:  + e.getMessage();  //
 you may want to catch any other exceptions and do something about them
   }

 }

 It might not be the most efficient practice to perform the try/catch
 within the loop, but if somebody else is sending you dodgy XML there
 might not be anything you can do.

-- 
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: XmlPullParserException: expected: START_TAG

2010-02-04 Thread Pankaj Deshpande
Hello,
When I use SoapEnvelope.VER11, it works fine, But when I use
SoapEnvelope.VER12, it gives me error:
org.xmlpull.v1.XmlPullParserException: expected: START_TAG.
This is my code...


import java.io.IOException;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;

import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;


import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class MyWebService extends Activity {
private static final String SOAP_ACTION = http://your_URL/
your_mathod_name;
private static final String METHOD_NAME = your_mathod_name;
private static final String NAMESPACE = http://your_URL/;;
private static final String URL = http://your_URL/WebService.asmx?
WSDL;
private Object resultRequestSOAP = null;
String data = some data;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
setContentView(tv);
try {

SoapObject request = new SoapObject(NAMESPACE, 
METHOD_NAME);
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER12);
envelope.encodingStyle = 
SoapSerializationEnvelope.ENC2001;
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
request.addProperty(METHOD_NAME, data);
envelope.bodyOut = request;
SoapObject response = null;
HttpTransportSE androidHttpTransport = new 
HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
// get the data
 response = (SoapObject) envelope.bodyIn;

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}

}
}

Can u tell me why is this happening with SOAP1.2 ?
Do I need to specify some encoding style for SOAP1.2 ?

Regards,
Pankaj.

On Feb 4, 10:40 am, Kevin Duffey andjar...@gmail.com wrote:
 Like the others said.. it sounds like a starting element is not being found
 before either some text or an end tag. Usually you'll see that error with
 something like:

 node1
   /node2
   node3
    /node3
 /node1

 Or

 node1
 /node1
   some text
 node2
 /node2

 It ALSO depends on how you are moving thru the xml parser.. if you are using
 parser.next() you are moving one parsing element at a time, which means
 you'll find every possible element including text, tags,white space, etc. If
 you use parser.nextTag() you may skip over that 2nd example text issue and
 find node2 start tag.



 On Wed, Feb 3, 2010 at 2:29 PM, Nicholas Albion nalb...@gmail.com wrote:
  If you determine that the problem is that the XML (or HTML!) is badly
  formatted and you have no control over it, you can do something like:

  int n;
  while( (n = xpp.getNext()) != END_DOCUMENT ) {
   try {
      // do your parsing element-by-element
   } catch( org.xmlpull.v1.XmlPullParserException e ) {} // ignore the
  exception
   } catch( Throwable e ) {
      log.warning(error while parsing file:  + e.getMessage();  //
  you may want to catch any other exceptions and do something about them
   }
  }

  It might not be the most efficient practice to perform the try/catch
  within the loop, but if somebody else is sending you dodgy XML there
  might not be anything you can do.

  --
  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.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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: sticky client IP address?

2010-02-04 Thread Bob Kerns
Indeed, interesting stuff. Thanks for the reference to PDP; it
explained a few of the lower-level things that have been puzzling me.

However, it's still misleading, because you are focusing on the
transport layer, and NOT on the TCP/IP layer.

It is not correct that TCP/IP begins and ends at the edge of the cell
network, on the network provider's Internet gateway -- UNLESS you
would choose to describe your typical home network with NAT router
that way.

The usual way to describe this situation is, You have TCP/IP
connectivity to the internet, but sit behind a firewall.

Indeed, you can't build IP connections to your phone via the cellular
path. (Except maybe you can reply with an FTP data connection --
dunno, haven't tried it. That would be up to the gateway to allow or
not -- and the only way it would allow it would be based on having an
outgoing FTP control connection, and doing the reverse translation
when the connection comes back. I can think of several good reasons
NOT to support this.)

However, the connection by which I will post this, from my laptop, is
generally considered to be a TCP/IP connection. From *MY* side, I
really can't tell that there's any NAT going on. My browser will do a
DNS lookup (which will be handled by my router), giving me a routable
IP address for Google's groups.google.com server. My laptop happens to
be hardwired at the moment, so it'll go directly to Ethernet, after
first wrapping the TCP/IP packets in ethernet headers. At my network's
edge, the ethernet headers will be stripped, and the IP headers will
be stripped and new ones created. My private IP address will be
replaced with one that Comcast has assigned me. Comcast could do the
same trick, of giving me a private IP address and using NAT at their
edge, but they don't. (The economics are different -- the amount of
bandwidth involved is hugely more).

My router will then put on new ethernet headers, to transmit to my
cable modem, which will strip them off, update the hop count in the IP
headers, and wrap them in DOCSIS headers for transmission on the cable
modem. The cable head will strip the DOCSIS headers, and forward the
TCP/IP payload to the next hop, after incrementing the hop count.

At any point along the way, these packets may be split up into smaller
packets.

Google will see, not the IP address of my laptop, but the IP address
assigned by Comcast. This address is shared by all the devices on my
home network, including my phones. Well, except for my digital Comcast
phone, and my cable box, each of which has its own IP address!

PDP is no different from any of this transport layer stuff. It is
basically a frame relay system, according to your reference -- and I
was running TCP/IP over frame relay in 1995.

So why does all this matter? It's best to look at it functionally:

Here's what's in it for us, at the level of TCP/IP:
* We can open TCP/IP connections normally.
* Our IP address, when communicating over the cellular network will
not be the one that the server sees. The source port may be different,
too.
* We cannot get incoming TCP/IP requests from the cellular network.
* This is no different from being behind a NAT firewall, except no
possibility of the admin opening up an incoming port forwarding for
you.
* Traceroute will show you the hops that the IP traffic takes, but not
show you any internal structure those hops may have. You only see the
IP routers along the way.
* You can't even tell that any of this is going on -- except by the
incoming silence, or sites that explicitly report back to you what IP
address they see.

To illustrate this, here's my phone's current state (I just turned off
the wifi):

rmnet0Link encap:Ethernet  HWaddr EE:B1:E9:38:05:3D
  inet addr:25.128.179.204  Bcast:25.128.179.207  Mask:
255.255.255.252
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:21853 errors:0 dropped:0 overruns:0 frame:0
  TX packets:21170 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:7958701 (7.5 MiB)  TX bytes:2785940 (2.6 MiB)

# /system/xbin/bb/route
/system/xbin/bb/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref
Use Iface
10.165.17.242   *   255.255.255.255 UH0  0
0 rmnet0
10.177.0.34 *   255.255.255.255 UH0  0
0 rmnet0
25.128.179.204  *   255.255.255.252 U 0  0
0 rmnet0
default 25.128.179.205  0.0.0.0 UG0  0
0 rmnet0

The 25.128.179.204/30 subnet is a point-to-point link, consuming 4 IP
addresses, but those IP addresses only mean anything to the two
partners.

All traffic goes to that 25.128.168.205 on the other end of the radio
link. It's not processed as TCP/IP until it reaches there -- until
then, it's just travelling a virtual circuit, taking all net traffic
from my phone to that destination.

Eventually, my IP address in the source address header fields is

[android-developers] Re: Help needed with parsing some XML data !

2010-02-04 Thread MobDev
Well,
to be honest your first idea was also mine :P So I already looked via
Google but to be honest I haven't found that many clear discussions/
explanations...
I also tried idea 2 and this is what I got :

Congratulations

The document located at http://x was successfully checked as
well-formed XML. This means that we were not able to determine the
exact document type, but that the document passed the XML well-
formedness syntax check. If you wish to wish to perform formal
validation of the document, you can use the Document Type: option of
the validator. 

But also this has been found, even though I do not know how important
this is :
The DOCTYPE Declaration was not recognized or is missing. This
probably means that the Formal Public Identifier contains a spelling
error, or that the Declaration is not using correct syntax, or that
your XML document is not using a DOCTYPE Declaration.

Validation of the document has been skipped, and a simple check of the
well-formedness of the XML syntax has been performed instead. 

Als, just to point out, at this point i CAN read out the XML stream by
using the
Xml.parse(is, Xml.Encoding.ISO_8859_1, new ExampleHandler(myAdapter));
method...
The only problem that remains is when I try to write on-screen the
values...
Btw, is there a way to trasform such a String (for example from a
Country ID=2 CName=Åland eilanden/  tag) to utf-8 ?
I have experienced such a problem on the iPhone some time ago, it also
received the data as ISO-8859-1 but the STring had to be encoded to
UTF8 to be shown correctly onscreen

On 4 feb, 11:47, Frank Weiss fewe...@gmail.com wrote:
 I have two ideas for you, Mobdev:

 1) Google for not well-formed (invalid token) and see what other people
 have found regarding this error.
 2) Go to validator.w3.org and see if the XML file in question is indeed
 valid or not.

 Please let us know what you find out.

-- 
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 load XML files dynamically

2010-02-04 Thread MrChaz
The LayoutInflater has an inflate() method which lets you do this:
http://developer.android.com/reference/android/view/LayoutInflater.html

On Feb 4, 12:00 pm, Shekhar shekhar...@gmail.com wrote:
 Hi Folks,

 I need help on how to load XML  file dynamically in the code.I have an
 activity and for the activity I have 5 xml layout files.I want to load
 one of the XML file depending on the some logical condition.for e.g

 switch(i)
 {
 case 1:
 //load XML file 1
 break;
 case 2:
 //load XML file 2
 break;
 case 3:
 //load XML file 3
 break;

 }

 Please help me with some code snippet as i am new to the android
 Programming.

 Thanks,
 Shekhar

-- 
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 use com.android.internal.telephony

2010-02-04 Thread James Wang
I recommend you develop your app in Eclipse and build it under android
source.

-- 
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: sticky client IP address?

2010-02-04 Thread Mike
Your description of NAT and firewalls is entirely correct.
Unfortunately, NAT is not a good description for what is actually
happening on the cell network.  In the case of your home PC behind a
NAT and Google (or the Internet) on the other side... both networks on
each side of the NAT are in fact using TCP/IP to transport data
packets around.

However, in the case of the cell network, the transport protocol is
NOT TCP/IP.  The use of TCP/IP is only relevant on the Internet side
of the gateway.  An IP address is entirely meaningless within the cell
network.

The part which is similar to the operation of NAT is that the gateway
maintains a table of which port numbers are associated with which cell
phones (the PDP Context).  Outgoing packets create a context which
includes the gateway IP address and a port number on that gateway.
The gateway creates a table of port numbers and their associated
devices, responses coming back to that specific port are then routed
to the device using whatever transport protocol the cell network uses
(GSM, EDGE, GPRS, CDMA, etc).  It is quite likely (depending on how
busy the gateway is) that once the response has been received, the PDP
Context is freed and your next PDP Context will almost certainly have
a diffierent port number, if not a different IP address.

And (on the same topic) this explains why you might sometimes see two
different IP adresses as being associated with your cell phone at
the same time.  Each and every connection to the Internet follows its
own path and those paths can easily be assigned a different gateway...
which cell tower you are connected to is entirely irrelevant in this
context.

- Mike
NAVTEQ Network for Developers
http://NN4D.com

Disclaimer: I work for NAVTEQ and these are my personal opinions which
do not necessarily reflect NAVTEQ’s views

-- 
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: try to see hprof dump from ddms

2010-02-04 Thread James Wang

 but i find out
 if my app(a simple HelloWorld) is built by mydroid (i.e. using
 Android.mk)
 it always complains permission denied
=what's mean built by mydroid? you mean build under android source?
can you paste some logcat?

-- 
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: Help needed with parsing some XML data !

2010-02-04 Thread Bob Kerns
The problem is, I can't reproduce your problem.

I don't know why you don't know how to see a stack trace in Eclipse,
so I'm not quite sure how to tell you how. :=)

* You should be in the Debug perspective.
* Select the Breakpoints view in the Debug perspective.
* Click on the little exclamation point icon on the Breakpoints view
toolbar, and enter Exception, to add a breakpoint on all Exception's
being thrown.
* Debug the program, and do any interactions required to trigger the
problem.
* Stacktrace will appear in the stacktrace window.

If, however, I edit your code to do:
InputSource in = new InputSource(url.openStream());
in.setEncoding(utf-8);
xr.parse(in);

Exception in thread main
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException:
Invalid byte 2 of 2-byte UTF-8 sequence.
at
com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:
674)
at
com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:
362)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:
1742)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:
1064)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:
813)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:
1539)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:
1316)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)

at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:
648)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:
510)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
807)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:
107)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:
1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(SAXParserImpl.java:522)
at Foo.main(Foo.java:25)

Which isn't the same error at all.

I think the problem may start earlier in the file, and be detected
here. I concur with Frank about validating your XML separately.

But good luck with googling it. Other SAX parsers, notably including
Python, give the same error, plus lots of people have invalid input,
so you get a huge amount of noise. Looking at the SAX source to see
exactly how you get the error might help.

On Feb 4, 1:12 am, MobDev developm...@mobilaria.com wrote:
 hehe,
 my bad I said Netbeans but I actually use Eclipse :P
 Still used to J2ME with NetBeans thats why I mixed up...
 Anyways, I do get the error (exception) which I already posted in one
 of my first posts :
 At line 40, column 23: not well-formed (invalid token)

 They *MUST* be valid printing Unicode
 characters. No random control characters -- for example, ISO-8859-1
 byte values 0-31 (decimal). This will ALWAYS fail -- it is NOT well-
 formed XML. If that's the cause of your exceptions
 Well I did paste the error-generating xml entry which for example is :
 Country ID=2 CName=Åland eilanden/

 It would help
 if you posted the URL to the XML 
 Unfortunately I am not allowed to do so :( It's a URL which is
 actually in use by our already exisiting software...

 Also I noticed my previous post was posted three times ! My apologies
 for that, I actually can't remember pushing the Send button three
 times :P

 On 3 feb, 19:02, Bob Kerns r...@acm.org wrote:



  Yeah, that's not what I mean by a test case.

  Seehttp://junit.orgasa starting point.
  (The Android SDK includes some limited version of JUnit I don't
  recognize. It's adequate for this purpose, but the full, modern
  version is better. For non-device testing, you're not restricted to
  the supplied one.)

  Basically, a test case is code that you can run to *automatically*
  test some specific aspect of a system. In this case, checking against
  a known set of XML (so it doesn't change), looking for the known
  desired result, and reporting failures (expected conditions not
  matching) and errors (unexpected exceptions thrown).

  This removes the variables from the equation. You're not depending on
  how things display, either in the UI nor in the log stream and
  windows. You're not dependent on a human to notice a problem.

  An best of all, you can automate it to always run when you build, so
  if you break later, you'll find out 

[android-developers] Re: How to run android application from super user(administrator) mode

2010-02-04 Thread Asif k
Is it possible to spawn a new process from the activity with su mode
and then run the script??
i had given the shell script as bellow but does not give fruitful
output,


stored in the device: /data/local/hello.sh
#!/system/bin/sh
(ifconfig wlan0 up)su
exit

and form Java code,

Process process = Runtime.getRuntime.exec(/data/local/hello.sh);

Can anyone please help me on this

Thanks,
Asif
On Feb 4, 11:39 am, Asif k asifk1...@gmail.com wrote:
 Hi all,

    I am running a shell script stored in the device from android
 application by creating instance of Process class.
   But my script has commands which will be executed only in su mode.
 any idea how to accomplish this?

 Thanks,
 Asif

-- 
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 load XML files dynamically

2010-02-04 Thread Shekhar
Hi Chaz,

Thanks for your prompt reply.I need a sample program where i can see
the usuage of inflate method so that it will be easy for me to
understand.Appreciate if you could help.

Thanks,
Shekhar

On Feb 4, 5:41 pm, MrChaz mrchazmob...@googlemail.com wrote:
 The LayoutInflater has an inflate() method which lets you do 
 this:http://developer.android.com/reference/android/view/LayoutInflater.html

 On Feb 4, 12:00 pm, Shekhar shekhar...@gmail.com wrote:



  Hi Folks,

  I need help on how to load XML  file dynamically in the code.I have an
  activity and for the activity I have 5 xml layout files.I want to load
  one of the XML file depending on the some logical condition.for e.g

  switch(i)
  {
  case 1:
  //load XML file 1
  break;
  case 2:
  //load XML file 2
  break;
  case 3:
  //load XML file 3
  break;

  }

  Please help me with some code snippet as i am new to the android
  Programming.

  Thanks,
  Shekhar

-- 
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 menu items

2010-02-04 Thread manigault
Hi all,
I want to customize option menu items. I can change icon when
selecting using a selector but how can i change the text color during
selection. If it was TextView i could use again selector for textColor
property but for menu items there is only resource for textValue not
for textColor. So my question is how can i change the textColor of
MenuItems on selection.

-- 
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: DNS Query

2010-02-04 Thread Bob Kerns
Ah, this provides a lot more context -- but not all of it!

Normally, this sort of thing is handled through DHCP or similar. I
don't know if you have access to the server providing the information
-- are you the carrier?

To change the DNS resolution policies in any way, will require root
access, and have global impact. Do you own these devices? Or are you
developing an app for public consumption?

The one (nearly) sure-fire way to do this, is to query the DNS server
yourself, in the application. The (nearly) is because firewalls can
intervene.

I would urge you to avoid any sort of temporary change to the global
DNS resolution. It's one thing if you have control over the device and
pre-configure it for the users. But temporary changes to DNS
configuration has a way of going bad when events happen in other than
the expected order. And if you get two applications trying to impose
THEIR will on an entire platform, it's a formula for chaos.

I don't know how DNS resolution is configured on Android, but this may
be useful:

# getprop | grep dns
[net.change]: [net.dnschange]
[net.dnschange]: [878]
[dhcp.eth0.dns1]: []
[dhcp.eth0.dns2]: []
[dhcp.eth0.dns3]: []
[dhcp.eth0.dns4]: []
[net.dns1]: [10.177.0.34]
[net.rmnet0.dns1]: [10.177.0.34]
[net.rmnet0.dns2]: [10.165.17.242]
[net.dns1.161]: [10.177.0.34]
[net.dns2.161]: [10.165.17.242]
[net.dns2]: [10.165.17.242]
[net.dns1.79]: [10.177.0.34]
[net.dns2.79]: [10.165.17.242]
[net.dns1.31939]: []
[net.dns2.31939]: []
#

If you're connected via wifi, the dhcp.eth0.dns* entries are filled
in instead; the above is with Wifi disabled.

Still -- and I don't know the 3GPP protocols here, but if they're not
deviating too much from how things were designed, any old DNS server
should be able to supply you with the information. The DNS server you
contact will, based on the domain requested, contact the appropriate
DNS server and obtain the information, cache it, and relay it to the
requester.

Perhaps this is not suitable for this for some reason, but if so,
realize the reason it's hard is because 3GPP is doing it wrong --
that is, using tools in ways they weren't intended. Maybe it's all
worthwhile; I don't know, I'm just trying to give you helpful context
and info, not technical judgments.

Fun historical fact: In 39 days (March 15), it will be the 25th
anniversary of the very first DNS registration, Symbolics.com. (The
domain name was recently purchased). I worked at Symbolics from
1981-1987, so it's an occasion I remember well.

On Feb 3, 11:07 pm, Android Development indodr...@gmail.com wrote:
 Bob, making a DNS query by the application is a standardized procedure of
 3GPP (3rd generation partnership project). All Mobile devices need to query
 a DNS server installed in the VoIP network to find the address of the server
 which will process their requests. This DNS server is under the control of
 the VoIP service provider and provides the IP address of the VoIP server.

 Devices are pre-configured with the domain name of their home network (
 atlanta.com for example). They need to find the IP address of the server on
 that domain by firing a DNS query. The DNS server's IP address is also
 a configurable parameter in all soft clients.

 My question was regarding this use case.

 This procedure is standardized as the DNS/DHCP procedure of discovering the
 outbound proxy server by the mobile client.

 With this background, if I need to query a DNS server installed on a given
 IP address on the network, is it technically feasible ? Or will the
 operating system automatically resolve the next hop based on the resolv.conf
 file (if it is configured there) if i try and send a request to atlanta.com?



 On Wed, Feb 3, 2010 at 10:55 PM, Bob Kerns r...@acm.org wrote:
  I didn't mean that to be harsh, BTW. Knowing that an approach is out
  in left field, and why, is useful information. Some of the most useful
  information you can get, as a beginner, since it narrows the focus of
  what you have to learn, a lot!

  On Feb 3, 9:21 am, Bob Kerns r...@acm.org wrote:
   Then you are doing something VERY strange.

  --
  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.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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 2.0.1 SocketTimeoutException received with FTP Data channel

2010-02-04 Thread Bob Kerns
Ah, given that both sides are loopback, TCP/IP doesn't really even
enter into it in a meaningful way. I think the problem pretty much has
to be with your client.

I began suspecting that once you mentioned that closed connections
stayed open until you killed the process. A RST on one should trigger
a close on the other side.

I've had good luck with openSSH, and though I've not used it heavily,
I've heard good things from others, so I think it's a solid choice.
But google around, there are others.

Another possibility is to use OpenVPN. This will let your clients talk
directly to the target server or servers, rather than to a local
forwarded port. This is a lot more flexible, if that's a good thing.
If you want to lock down and limit access, you're better off with port
following.

On Feb 3, 10:55 pm, mericksonj mericks...@gmail.com wrote:
 The lack of an application-level timeout does explain why software
 will generally hang.

 The error message that I've seen the most is as follows:
 java.net.SocketTimeoutException: The operation timed out

 Now,  in my tests with a PC, the sockets are generated and torn down
 dynamically with the client always connecting with its random port to
 the same passive port on the server.

 The android device will not tear the connection down however after the
 exception.  The session will stay up indefinitely as established on
 both ends until I kill the port forwarding process.

 There does also appear to be situations where I can get a directory
 list received from the server to show up on the client device
 (subsequent cwd commands work, but list will fail), but it seems to be
 intermittent and very erratic.  Which leads me to take more notice of
 the buffer messages rather than a specific point in the code that
 breaks down.

 As for NAT or Firewall issues, all client communications are looped..
 meaning that with the TCP tunneling in place, all FTP packets are sent
 to 127.0.0.1 where it is picked up by SSH for crypto and encaps into
 another IP packet.  Once at the SSH server, the outer packet is
 stripped, contents are decrypted and sent to the FTP server.  The FTP
 server (same box as the SSH server) thinks it came from 127.0.0.1 and
 uses that same IP for its replies.  I guess that's just the long way
 of saying that each device thinks it's talking to itself, so there's
 no NAT or firewall confusion.  At least not until I move the FTP
 service off my SSH server, but even then IP masquerading in the
 proftpd_conf will fix the NAT issue.

 I really think a TCP dump would help the issue.. at least I could see
 how big the FTP packets are, if they're being fragmented, and when/
 where they're being sent.  I just found the tcpdump on the emulator,
 how can I filter out the non-interesting packets?

 I would like to try similar port forwarding tests using adb or other
 tools, is there a recommended tutorial on how to use the port
 forwarding there?  will it be able to simulate what I'm doing with
 SSH?

 Also maybe trying a different SSH client would help, is there anyone
 besides connectbot that accepts RSA keys and allows TCP port
 forwarding?

 --
 Regarding the security discussion, I think in my setup I'm pretty safe
 since all FTP packets are looped within client/server platforms as
 described above, but you do make a case for FTPS w/out encryption that
 could maybe alteast mask the username and password within the system
 or in case I ever do move the FTP server off the SSH box, then again,
 it is at least on a trusted network once the SSH server decrypts it.

 Again, Thanks!
 --James

-- 
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 2.0.1 SocketTimeoutException received with FTP Data channel

2010-02-04 Thread Bob Kerns
Are there any SSH clients that DON'T support RSA keys and port
forwarding?

-- 
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: Text To Speech Android 1.6 with minsdk 3

2010-02-04 Thread Eric Carman
Hello Tone,

You definitely have to target the 1.6 (or greater) platform for this
to compile.

I remember having trouble getting the debugger to attach to the 1.5
emulator. I don't remember if I was able to do that or if I relied on
Toast/log messages to zero in on my 1.5 specific issues. I'm not near
the proper computer now to test it out. I vaguely recall having to
make sure the 1.5 emulator was the only one running and I had to start
it explicitly before running the application - not sure why that
mattered, but...

All of this may depend on what version of the SDK you have installed
(1.6, 2.0, ...). Currently I have installed v2.0.

HTH

Best Regards,
Eric

-- 
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] conditional build

2010-02-04 Thread AndroidGeek
Hey,

I am working on building an android reusable library for developer. I
had a third party jar file may or may not build in to my project. I
want to create build system to build two version of my jar files: one
with third-party jar and one without. And also I have a wrap class to
reference the third party jar, and also I want to disable that. Like C+
+, you can also define pre-processor to protect your code, how I can
do it on android. And create conditional build system to build
project.


Thanks in advance.

-- 
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 stop accelerometer sensor running in background?

2010-02-04 Thread Abhi
I have an app where the accelerometer runs in the background and
continues to read values from the sensor even after the activity
exits.

Here is how I am trying to stop it

@Override
protected void onStop()
{
 mSensorManager.unregisterListener(mSensorListener, mySensor);
 super.onStop();

 }

Am I doing it wrong?

Abhi

-- 
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 learn Android build system

2010-02-04 Thread peng peng
hi
Could anybody give me some suggestion about android build system?
It is too diffcult for read to me.

sorry for my poor 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 stop accelerometer sensor running in background?

2010-02-04 Thread Abhi
Also, the app exits only when I press the back button.


On Feb 4, 9:14 am, Abhi abhishek.r.sha...@gmail.com wrote:
 I have an app where the accelerometer runs in the background and
 continues to read values from the sensor even after the activity
 exits.

 Here is how I am trying to stop it

                     @Override
             protected void onStop()
             {
              mSensorManager.unregisterListener(mSensorListener, mySensor);
              super.onStop();

              }

 Am I doing it wrong?

 Abhi

-- 
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: removing item from ListView

2010-02-04 Thread Stefan
Hello again,

now all works fine with the ListView. I create my own class called
ListHelper and add all relevant information for one row in a
ListListHelper object:

for(int i=0; idescription.size(); i++)
{
list.add(new ListHelper(text, string for image, second text);
}

and in the viewwrapper class, i set the image resource depending on
the string for image.


if(getModel(position).getSymbol().equals(right))
{
wrapper.getIcon().setImageResource(R.drawable.right);
}
else if //

And the error with my adapter:

i dont handle:

if(getModel(position).getSymbol().equals(left))
{
wrapper.getIcon().setImageResource(R.drawable.left);
}
else if

because i thought, that this is covered with the
ImageView getIcon ()
{
if (icon==null)
icon = (ImageView)base.findViewById(R.id.left);
return icon;
}


Thanks for your help again,
Stefan

-- 
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] android and google docs

2010-02-04 Thread David Toledo
Hi All

How to read spreadsheets from google docs in android app ?

Thanks
David

-- 
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] howto extend LinearLayout?

2010-02-04 Thread Holger
Hi there,

I'm am trying to learn how to create LayoutGroups. For a start, I
created MyLinearLayout which is supposed to force all children into
same width (yes, there is layout_weight, but that's beside the
point :-)

However, the children won't show up. What am I missing here?

public class MyLinearLayout extends LinearLayout {

public MyLinearLayout(Context context) {
super(context);
}

public MyLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}

private final static int PADDING = 2;

@Override
protected void onLayout( boolean changed, int l, int t, int r, int
b ) {
//super.onLayout( changed, l, t, r, b );
//if( !changed ) return;
int len = getChildCount();
int w = ((r-l)-(len-1)*PADDING)/len;
int pos = l;
for( int i=0; ilen; i++ ) {
View c = getChildAt(i);
c.layout( pos, t, pos+w, b );
pos += w + PADDING;
}
}

@Override
protected void onMeasure( int wSpec, int hSpec ) {
int ws = MeasureSpec.getMode( wSpec );
int w = MeasureSpec.getSize(wSpec);
int hs = MeasureSpec.getMode( hSpec );
int h = MeasureSpec.getSize(hSpec);
setMeasuredDimension(wSpec,hSpec);
int len = getChildCount();
int w1 = (w-(len-1)*PADDING)/len;
for( int i=0; ilen; i++ ) {
View c = getChildAt(i);
c.measure(
MeasureSpec.makeMeasureSpec(w1,ws),
MeasureSpec.makeMeasureSpec(h, hs)
);
}
//super.onMeasure( wSpec, hSpec );
}

}

-- 
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] ContentProvider's DB file access right problem when its android:multiprocess=true

2010-02-04 Thread soccercheng
  According to Android Dev Guide (http://developer.android.com/intl/zh-
TW/guide/topics/manifest/provider-element.html), it says thatif
android:multiprocess is set to true, the system can create an
instance in every process where there's a client that wants to
interact with it, thus avoiding the overhead of interprocess
communication.

But...  since the multiple ContentProvider instances are running in
different process space, how do they access the DB file that was
created in different process space or user ID?

I've checked browser  in its packages/apps/Browser/
AndroidManifest.xml:  android:multiprocess=true
/data/data/com.android.browser/databases
-rw-r--r-- app_12   app_12512 1903-02-27 13:29 webviewCache.db-
journal
-rw-rw app_12   app_12   5120 1903-02-27 13:29 browser.db
-rw-rw app_12   app_12   6144 1903-02-27 13:29 webviewCache.db
-rw-rw app_12   app_12  14336 1903-02-27 13:29 webview.db

Does any one know why???

-- 
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: Basic Emma code coverage tutorial needed

2010-02-04 Thread Chander Pechetty
I just replied a gentleman on this forum at http://bit.ly/cikIiz.
Basically you go the command line to your tests folder and run ant
coverage



On Feb 4, 4:20 am, Mapara,Harshit hnmap...@gmail.com wrote:
 Hi All,

 I am looking a way to use Emma on Android project. I have an
 application -project, and withing that, I have Junit test cases.
 Now How do I use Emma tool(command line) to get code coverage report
 on testcases?

 I searched a lot but could not find a good/simple tutorial.
 I read somewhere that Android ant lib has a target coverage that
 does all thing, (running test cases, generating emma report). How do I
 use that?

 THanks
 Harshit

-- 
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


Re: [android-developers] Re: how to load XML files dynamically

2010-02-04 Thread TreKing
On Thu, Feb 4, 2010 at 7:26 AM, Shekhar shekhar...@gmail.com wrote:

 I need a sample program where i can see
 the usuage of inflate method so that it will be easy for me to
 understand


No, you need to put some time and effort into doing your own work and then
posting back here if you get stuck on specifics.
MrChaz already pointed you to the class and function you need to use.
Reading the documentation on the function and playing with it for about 5
minutes should be all you need to get going.

-
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 
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 stop accelerometer sensor running in background?

2010-02-04 Thread JP

There's more to it than onStop(). Check out onPause(), or better yet,
revisit the documentation on the Activity model.
So you get  sense of the dynamic, override all activity methods, place
logs in them and play around so you get a feel which method gets
called when.



On Feb 4, 6:14 am, Abhi abhishek.r.sha...@gmail.com wrote:
 I have an app where the accelerometer runs in the background and
 continues to read values from the sensor even after the activity
 exits.

 Here is how I am trying to stop it

                     @Override
             protected void onStop()
             {
              mSensorManager.unregisterListener(mSensorListener, mySensor);
              super.onStop();

              }

 Am I doing it wrong?

 Abhi

-- 
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: Emma Code Coverage

2010-02-04 Thread Chander Pechetty
A few more notes to make it clear.

1. The default built.xml can be copied to the tests folder and change
the name of the project in build.xml to your test project's name.
2. You also need the build.properties
application.package=your_test_package_name ( This has to be different
than your tested project for obvious reasons)
tested.project.dir=..
tested.project.absolute.dir=..
The remaining two properties are the location of your actual project
you are testing

All this is evident if you read the build.xml file and the template
rules. (and I stand corrected on my previous post, the documentation
is in the build.xml file and not in the template files ).


Cheers,
Chander

On Feb 4, 11:13 am, Chander Pechetty cspeche...@gmail.com wrote:
 Hi Matthias,

 SDK_PATH/platforms/android-2.0.1/templates/android_test_rules.xml
 contains the rules for your test project just as android_rules.xml
 contains the rules for a regular android project.

 When you create a project using android create project , the
 build.xml generated uses the rules from these rule files by default.
 Seehttp://developer.android.com/guide/developing/other-ide.html

 The documentation is present in the rule files. So run ant coverage
 to run the tests and generate coverage reports.
 Several examples of tests are present in android source , for example
 tests for the Calculator app can be found 
 herehttp://android.git.kernel.org/?p=platform/packages/apps/Calculator.gi...

 Thanks
 Chander

 On Feb 3, 3:12 pm, matzebr...@googlemail.com

 matzebr...@googlemail.com wrote:
  Hi,

  we're using android for some software engineering courses at our
  university. The students should produce code coverage reports for
  their unit tests, so we looked at the android-2.0 SDK which says on
  the release page:

  Adds new Ant build system with support for Emma instrumentation
  projects (code coverage).

  However I'm unable to find any documentation or examples for this.
  Does someone have more information about it?

  Greetings,
       Matthias Braun

-- 
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


Re: [android-developers] android and google docs

2010-02-04 Thread Greg Donald
On Thu, Feb 4, 2010 at 8:56 AM, David Toledo dtole...@gmail.com wrote:
 How to read spreadsheets from google docs in android app ?

Have you tried a WebView?

http://developer.android.com/intl/fr/reference/android/webkit/WebView.html


-- 
Greg Donald
destiney.com | gregdonald.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] Draw clock like minute hand

2010-02-04 Thread Sonic
Hi all.

Just a quick question, how would i go about implementing a clock like
hand that rotates around a centre point to different positions
depending on a value.

e.g. I send it a value of 3, and it points to the 3'o'clock position
of a circle.

protected void onDraw(Canvas canvas)
{
Paint line = new Paint();
line.setStrokeWidth(3);
line.setColor(Color.BLUE);
line.setStyle(Paint.Style.STROKE);
canvas.drawLine(55, 155, 125, 15, line);

}

I have the following fully working so it draws the line, but i dont
understand how i could get one end of the line to always rotate around
the centre fixed position.

Do you have any ideas?

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: options menu items

2010-02-04 Thread skink


On Feb 4, 2:27 pm, manigault manig...@gmail.com wrote:
 Hi all,
 I want to customize option menu items. I can change icon when
 selecting using a selector but how can i change the text color during
 selection. If it was TextView i could use again selector for textColor
 property but for menu items there is only resource for textValue not
 for textColor. So my question is how can i change the textColor of
 MenuItems on selection.

unfortunately, you can't

pskink

-- 
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] ListView scrolling behavior and performance

2010-02-04 Thread GDroid
Hi,

I have a listview showing contacts.

When I'm scrolling the list the scroll works pretty smooth however
when/if I'm trying to continue the scroll in the middle of the last
scrolling the scroll just stops and sometimes the item I clicked on is
selected (I have registered an OnClickListener to the item view).

I would like to get smooth scrolling just as in the device native
contact list.

My implementation builds each contact a view containing:
1. Big picture for the contact image.
2. Small picture for the type of the contact.
3. TextView with the Contact name
4. TextView with some extra text about that contact.

My current layout for every item looks like:
LinearLayout 
ImageView /
LinearLayout/
LinearLayout/
ImageView /
TextView/
/LinearLayout
TextView/
/LinearLayout
/LinearLayout

I've tried changing the LinearLayouts to relative ones but saw no
improvement in performance.

I've created my own Selector in code (to eliminate the time it takes
to load the resource) so that odd rows will have different background
color. The code looks like:

StateListDrawable draw = new StateListDrawable();
draw.addState(new int[] {android.R.attr.state_selected},
mSelectedRowDrawable);
draw.addState(new int[] {-99},mOddRowBG);
draw.addState(new int[] {},mRowBG);
view.setBackgroundDrawable(draw);


I'll be glad to give more details if needed.

Thanks for the 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: try to see hprof dump from ddms

2010-02-04 Thread fadden
On Feb 4, 1:00 am, allstars allstars@gmail.com wrote:
 so i would like to ask what's the difference here and
 what should i do if i want to see hprof when my app is built
 in mydroid

My guess would be that it's trying to write the hprof dump to a
temporary file on /sdcard, and your app doesn't have
WRITE_EXTERNAL_STORAGE permission.

See also dalvik/docs/heap-profiling.html:

  
http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/heap-profiling.html;hb=HEAD

-- 
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: Unable to parse hprof dump with MAT?

2010-02-04 Thread fadden
On Feb 3, 8:18 pm, Moto medicalsou...@gmail.com wrote:
 Any ideas?  I just used the Dump HPROF file button, and picked it up
 from the sdcard and opened it with MAT...

You need to run it through hprof-conv first.  The Android-specific
version can't be understood by MAT/jhat.  It has some additional
detail, like whether something was allocated in the main or zygote
heap.

I believe hprof-conv is part of the SDK.  You can also build it
yourself from a stand-alone source file.

See also:

  
http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/heap-profiling.html;hb=HEAD
  
http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=tools/hprof-conv/HprofConv.c;hb=HEAD

-- 
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: options menu items

2010-02-04 Thread Robert Nekic
I was about to start looking into this, too.  I have several items in
a More menu and I would like to slightly adjust the height of each
item.  I assumed I would discover a way to supply a layout definition
for the menu items but this is not possible?



On Feb 4, 10:38 am, skink psk...@gmail.com wrote:
 On Feb 4, 2:27 pm, manigault manig...@gmail.com wrote:

  Hi all,
  I want to customize option menu items. I can change icon when
  selecting using a selector but how can i change the text color during
  selection. If it was TextView i could use again selector for textColor
  property but for menu items there is only resource for textValue not
  for textColor. So my question is how can i change the textColor of
  MenuItems on selection.

 unfortunately, you can't

 pskink

-- 
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] Unable to get the trigger with Repeat Alarm when set in BootUp Sequence

2010-02-04 Thread Kasmoori Bindu
Hi All,

I have to run a particular background task everyday, hence  I chose to  set
a Repeat Alarm  as soon as BOOT_COMPLETE event is received with 24hrs  as
interval. When tested, observed that  alarm expiry is not received to the
IntentReceiver,  when phone successfully powers up. Unable to figure out the
root cause. Please  someone help  me to resolve this issue, as it is
blocking our Application. Appreciate, your quick response.

Best Regards,
Bindu

-- 
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: Strange platform error in Droid(2.0.1), Hero(1.5)

2010-02-04 Thread Justin Grammens
I am seeing this exact same stacktrace as well. I'm loading a Listiew
and am trying to progressively load more items once the last item is
hit. Is anyone else seeing this problem or have a fix? Very
frustrating since it happens randomly in my case. So it seems to be a
threading issue down inside Android?

On Dec 28 2009, 7:46 am, Abdul Mateen abmat...@gmail.com wrote:
 Well,
 I  am not using that any non-UI Thread, I am using AsyncTask that should not
 cause any problem. I do not know where this error is comming... working fine
 on emulator with 2.0.1 but this is primarily occuring on Droid.

 On Sun, Dec 27, 2009 at 1:43 PM, Frank Weiss fewe...@gmail.com wrote:
  I've run into similar stack traces. Prime cause in my case was my code was
  manipulating the UI from a non-UI thread.

  On Dec 27, 2009 9:29 AM, Abdul Mateen abmat...@gmail.com wrote:

  Hi,
  I have been running into strange problems. here is the stacktrace it seems
  , there is nowhere the error is in my application, I donot know why this
  exception/error is comming..

  java.lang.NullPointerException at
  android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355) at
  android.widget.ArrayAdapter.getView(ArrayAdapter.java:323) at
  android.widget.AbsListView.obtainView(AbsListView.java:1274) at
  android.widget.ListView.makeAndAddView(ListView.java:1668) at
  android.widget.ListView.fillDown(ListView.java:637) at
  android.widget.ListView.fillFromTop(ListView.java:694) at
  android.widget.ListView.layoutChildren(ListView.java:1521) at
  android.widget.AbsListView.onLayout(AbsListView.java:1113) at
  android.view.View.layout(View.java:6831) at
  android.widget.FrameLayout.onLayout(FrameLayout.java:333) at
  android.view.View.layout(View.java:6831) at
  android.widget.FrameLayout.onLayout(FrameLayout.java:333) at
  android.view.View.layout(View.java:6831) at
  android.view.ViewRoot.performTraversals(ViewRoot.java:996) at
  android.view.ViewRoot.handleMessage(ViewRoot.java:1633) at
  android.os.Handler.dispatchMessage(Handler.java:99) at
  android.os.Looper.loop(Looper.java:123) at
  android.app.ActivityThread.main(ActivityThread.java:4338) at
  java.lang.reflect.Method.invokeNative(Native Method) at
  java.lang.reflect.Method.invoke(Method.java:521) at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) at
  dalvik.system.NativeStart.main(Native Method)

  --
  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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

   --
  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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



-- 
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 2.0.1 SocketTimeoutException received with FTP Data channel

2010-02-04 Thread mericksonj
I'm already using openSSH for my server, it seems to work fine,
especially with the PC clients, I have used both putty and secureCRT
with this server and the FTP client (filezilla) works fine over both.

HTTP, telnet and even VNC work fine from the android devices, I
haven't quite ruled out TCP/IP, I wonder if there are fragmented
packets.. that coupled with a small FTP-D buffer..  could cause a
problem.

Is the buffering a function of the client software, the DALVIKVM, or
the native Linux?

As for other SSH clients, I haven't tried any others on the android,
I'll go to the marketplace and DL another.  I just don't think there
are any as highly rated as connectbot, and descriptions don't say if
they support the keys/forwarding.

This is my first look at openVPN, looks nice!  I'll give it a shot
when I'm not as busy at work and my latest cert exam.

Thanks!
--James

-- 
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] Using StaticLayout with a canvas to draw text.

2010-02-04 Thread julz
Hi,
I have figured out the static layout this far, but I have no idea how
to make it display my text anywhere else but in the top left corner.
StaticLayout layout =
new StaticLayout(text, getTextPaint(), 140,
android.text.Layout.Alignment.ALIGN_CENTER,(float)1.0, (float)0.0,
true);
layout.draw(canvas);

Thanks for your help.
Julz

-- 
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 precise scan when doing garbage collection

2010-02-04 Thread rookie
Hi all

I found that there are conservative scan and type precise scan when
garbage collector scan the thread stack.
Then I turn on the precise scan in the dalvim vm by adding some code
in
frameworks/base/core/jni/AndroidRuntime.cpp

 opt.optionString = -Xgenregmap;
 mOptions.add(opt);
 /* turn on precise GC while we're at it */
 opt.optionString = -Xgc:precise;
 mOptions.add(opt);

It surely assigns true to gDvm.preciseGc and generateRegisterMaps
when the dalvik startup.

However, in the function gcScanInterpStackReferences in dalvik/vm/
Thread.c,
the variable const RegisterMap* pMap always gets null when the
program executes:
pMap = dvmGetExpandedRegisterMap(nonConstMethod);.
Therefore, it always falls back to conservative scan.

Did someone has made the dalvik scan the stack frame precisely?
If so, teach me how to do it, please.
It's very urgent.

-- 
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 do you deal with spammers?

2010-02-04 Thread aForum Dev
Hi,

Our app, aForum, is a very popular forum app on the market. It had very good
user rating. Last week, our forum was spammed by some people out of nowhere
all of a sudden. The spamming included constant meaningless posts and vulgar
words for a while. We got short peaceful time after banning some people.
Early this week, they staged a second round of attack. After some
investigation, we found out these people were from a competing forum. We
have clear evidence that this is a well-coordinated attack.  From their
forum, they even talked about how to hack our system to initiate further
spamming. They left very low rating on our review plus flagging our app as
inappropriate. This resulted in the decrease of our rating recently.

Their forum does not seem to be moderated. I don't think their developers
are involved in these attacks. But I think they are at least partially
responsible for not doing diligent work because their app clearly violated
the market content policy:

http://www.android.com/us/developer-content-policy.html

We reported this issue to the Android team and has not receive and response
yet.

I would like to know your opinions about this if you have similar situation.

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] ASSERTION FAILURE building libdl

2010-02-04 Thread Harkin
I'm trying to build a full android image from source to run on a
TAO-3530 and I am running into a somewhat tough error.

$ make -j3

PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=MASTER

system/core/android-root/Android.mk:34: warning: overriding commands
for target `system/core/android-root/own.o'
system/core/android-root/Android.mk:15: warning: ignoring old commands
for target `system/core/android-root/own.o'
/bin/bash: line 0: cd: development/tools/layoutopt/app/src/resources:
No such file or directory
target Prelink: libdl (out/target/product/generic/symbols/system/lib/
libdl.so)
target asm: libc_common = bionic/libc/arch-arm/syscalls/_exit.S
target asm: libc_common = bionic/libc/arch-arm/syscalls/
_exit_thread.S
target asm: libc_common = bionic/libc/arch-arm/syscalls/__fork.S
target asm: libc_common = bionic/libc/arch-arm/syscalls/waitid.S
target asm: libc_common = bionic/libc/arch-arm/syscalls/__clone.S
target asm: libc_common = bionic/libc/arch-arm/syscalls/execve.S
ASSERTION FAILURE external/elfcopy/elfcopy.c:2538: [!delta || !
(shdr_info-shdr.sh_flags  SHF_ALLOC) || shdr_info-shdr.sh_type ==
SHT_NOBITS || shdr_info-shdr.sh_addr == shdr_info-
old_shdr.sh_offset]
make: *** [out/target/product/generic/symbols/system/lib/libdl.so]
Error 1
make: *** Deleting file `out/target/product/generic/symbols/system/lib/
libdl.so'

Also, Ive gotten similar errors with this lib before. They where
preceded by messages about duplicated nullspace and allspace from the
armelf.x linker script.

running
make libdl
brings about this error, I don't know if adding the libdl after make
does anything because the error is the same as just running make as
I have not cleaned since this error.

This is with the latest repo updates on 02/03/2010

Any help would be appreciated.

-- 
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] setUserAgentString not affecting browser user agent

2010-02-04 Thread doug
I am working on an application where I need to change the UserAgent
string of the browser:

WebView webview = new WebView(this);
String newUA = Foo-Bar/;
webview.getSettings().setUserAgentString(newUA);
setContentView(webview);

When I call:
webview.getSettings().getUserAgentString()
the application returns Foo-Bar/ as the UserAgent, but when I load a
url that specifically tells me the User Agent String:
webview.loadUrl(http://myurl.com;);

The browser is announcing itself with the default UserAgent string.

Any ideas?

Thanks
Doug

-- 
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 not compiling aidl file

2010-02-04 Thread jaffachief
Hi,
I cannot get eclipse to generate .java file from a .aidl file. Any
help would be appreciated

Cheers,
Magnus

-- 
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] Installing a Game Media to SD Card

2010-02-04 Thread Android
I have created a rather large game, 18 megs, and am sick of getting 1
star because of the size. Now normally I would just figure out how to
do this on my own but since this is something I'm only doing because
Google dropped the ball and may soon rectify,  I would really
appreciate it if some one would provide me with code to do the
following.

1. Make an HTTP connection to a server and dowload a .zip file to the
SD card.
2. Then unzip the file to a directory on the SD card.
3. Finally delete the .zip file.

Has anyone done this before? What are the gotchas? I'm sure doing this
comes at a cost, such as having to insure the graphics have been
downloaded, failed downloads, and if you have a future update you have
to manage updating the graphics yourself, am I missing anything?

Thanks Very Much,
Chad

-- 
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] 'SimpleCursorAdapter' symbol not found and related errors in notepad sample application.

2010-02-04 Thread Swiftguy
Hello All,

Im new to Android.
Trying to run the 'notepad' application on my local system (building
using ANT)

Getting following errors... tried by best to sort this prob .. but
unable to

for the SimpleCursorAdapter symbol found error .. i even imported the
base class file i.e 'import android.widget.CursorAdapter' ... but
still the same error.

Source code is listed below...

kindly help me out...thanks in advance.


-
[javac] /home/vikram/java-android/android-sdk/vik-apps/devGuide/
Notepadv1/src/com/tutorials /Notepadv1.java:69: cannot find symbol

[javac] symbol  : class SimpleCursorAdapter
-
 [javac] /home/vikram/java-android/android-sdk/vik-apps/devGuide/
Notepadv1/src/com/tutorials/Notepadv1.java:37: cannot find symbol
[javac] symbol  : variable menu_insert
[javac] location: class com.tutorials.R.string
[javac] menu.add(0, INSERT_ID, 0, R.string.menu_insert);
-



Notepadv1.java file


package apt.tutorials;

import com.tutorials.R;
import android.app.*;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase;
import android.widget.CursorAdapter;



public class Notepadv1 extends ListActivity {
private int mNoteNumber = 1;
private NotesDbAdapter mDbHelper;
   public static final int INSERT_ID = Menu.FIRST;


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mDbHelper = new NotesDbAdapter(this);
mDbHelper.open();
fillData();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
boolean result = super.onCreateOptionsMenu(menu);
menu.add(0, INSERT_ID, 0, R.string.menu_insert);
return result;
}

@Override
   public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case INSERT_ID:
createNote();
return true;
}

return super.onOptionsItemSelected(item);
}

private void createNote() {
String noteName = Note  + mNoteNumber++;
mDbHelper.createNote(noteName, );
fillData();
}

// Binding the layout text field to the Database Cursor

private void fillData() {
// Get all of the notes from the
database and create the item list
Cursor c = mDbHelper.fetchAllNotes();
startManagingCursor(c);

String[] from = new String[]
{ NotesDbAdapter.KEY_TITLE };
int[] to = new int[] { R.id.text1 };

// Now create an array adapter and set
it to display using our row
SimpleCursorAdapter notes = new
SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);
setListAdapter(notes);
}
}


-

res/layout/main.xml


?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

 ListView android:id=@android:id/list
android:layout_width=wrap_content
android:layout_height=wrap_content/

  TextView android:id=@android:id/empty
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=@string/no_notes/
/LinearLayout


--
notes_row.xml
=
?xml version=1.0 encoding=utf-8?
TextView android:id=@+id/text1
xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_width=wrap_content
android:layout_height=wrap_content/

-- 
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: Is passing AMR_NB into AudioTrack and AudioRecord valid?

2010-02-04 Thread Mainul Mizan
No, it is not using ARM_NB. Actually AudioFormat.ENCODING_DEFAULT =
0x1 which is being used. MediaRecorder.AudioEncoder.AMR_NB = 0x1 also.

On Feb 3, 11:24 pm, draf...@gmail.com draf...@gmail.com wrote:
 I currently use AudioTrack and AudioRecord to create a looping sound
 program and I was using raw PCM audio but I want to use AMR_NB audio
 so I set up the code as follows

 arec = new AudioRecord(MediaRecorder.AudioSource.MIC,
                                                        11025,

 AudioFormat.CHANNEL_CONFIGURATION_MONO,

 MediaRecorder.AudioEncoder.AMR_NB,
                                                        buffersize);
 atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL,
                                                        11025,

 AudioFormat.CHANNEL_CONFIGURATION_MONO,

 MediaRecorder.AudioEncoder.AMR_NB,
                                                        buffersize,

 AudioTrack.MODE_STREAM);

 The above code works fine but is passing
 MediaRecorder.AudioEncoder.AMR_NB in as the Audio Format valid or is
 it working but actually not being encoded as AMR_NB?

-- 
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] touch screen issue in android

2010-02-04 Thread sincity
Hi, Im newbie to Android and Im working in touchscreen module. In the
soft keyboard app. calibration is not happening properly ie.if i touch
some key i get keys which are nearby, and this does not  happens to
all keys. Now Im not able to figure out whether this could be touch
screen driver issue or the soft keyboard issue.
This calibration issue also happens in the menu window sometimes.
Please help me where to look for this issue. Also would be helpful if
I get info on how the touch is recognized by android. Please help.

Thanks alot.

-- 
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] Why is Android not supporting arabic? Will it be in the future?

2010-02-04 Thread Bilal
I cannot understand this.

Google takes care about adding arabic support in all it's products,
and they will in the future Chromium OS. But why the hell Android does
not support arabic? Is that a matter of technical issues or what?

With the iPhone you can switch on arabic and your all device is in
arabic, you can also have your contact list in both English and
Arabic.

What's the matter with arabic in Android?

-- 
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] Synchronize an AVD with ANdroid phone

2010-02-04 Thread Ali Chousein
Is it possible to synchronize an AVD with an Android phone? Like, I
would like to upload to an AVD my contacts list, calllog, SMS messages
etc. Such an upload, if possible will be very helpful, because
otherwise I have to create artificial data on the AVD.

Thank you in advance

-Ali

-- 
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: Pop-up without using Toast.

2010-02-04 Thread cchenow...@gmail.com
You could always just ask the developer.  His email is in the City
Caller ID application.

But, since I am here...

The best way to do anything in Android is to look at the source of
Android.  I looked at how a toast was done in the source and
implemented my own version of it.

You can message me directly if you need more information.  I can't
imagine Google would just want anybody doing this.  That is why I
won't post my Custom Toast code just yet.  It could be really
obnoxious if used incorrectly.

Now if I could just figure out how to add the city and state to the
Call Log.  I have combed the source and it looks like I would need a
custom Dialer Application. :(

Take care,
Chris

On Jan 11, 12:45 pm, Klaus Kartou kar...@gmail.com wrote:
 Heh yeah, that is true :) But how do you display something over the
 in-call screen?

 On Mon, Jan 11, 2010 at 6:36 PM, Mark Murphy mmur...@commonsware.comwrote:



  Klaus Kartou wrote:
   I would like to be able to do what they do in this app:

 http://www.threadabort.com/archive/2009/12/14/city-caller-id-my-first...

   
 http://www.threadabort.com/archive/2009/12/14/city-caller-id-my-first...
  In
   the screenshot, they draw a view in the buttom of the built-in caller
   activity.

  The author of the app you cited assumes all Android devices have the
  same in-call screen, and that will not be the case. Hence, the author
  has no way of knowing whether the stuff that is being displayed over the
  in-call screen will actually be over the top of something of value to
  the user, short of maintaining their own database of devices and where
  safe places to draw are.

  --
  Mark Murphy (a Commons Guy)
 http://commonsware.com|http://twitter.com/commonsguy

  Android 2.0 Programming Books:http://commonsware.com/books

  --
  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.comandroid-developers%2bunsubs­cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en- 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] takePicture function error: getPicture failed!

2010-02-04 Thread adrian
I write a take picture program for test. The program exports as a
application package and installs in real device. I start the activity
with the command adb shell am start -ncom.demo.android.cameracool/
com.demo.android.cameracool.CameraCool. The name of my program is
CameraCool.

When the activity start, input command adb logcat *:E in console to
monitor it. I get some error:

E/ServiceManager( 1138): add_service('SensorCalibrationManager',0x4b)
uid=1000 -
 ALREADY REGISTERED
E/ISystemManager( 1226): GET_UNIT_ID
E/CalLibrary( 1226): Sensors Started
E/CameraHardware( 1149): ioctl with CAMERA_EXIT failed
E/CameraHardware( 1149): set_total_zoom: vb6801_set_sensor_zoom_mode
fai
led!
E/CameraCool( 1970): open camera
E/CameraHardware( 1149): initRaw: clearing old mJpegHeap.
E/CameraHardware( 1149): pmem pool /dev/pmem_adsp ioctl(PMEM_GET_SIZE)
i
s 4718592
E/CameraHardware( 1149): TAKE PICTURE LOCK ACQUIRED
E/CameraCool( 1970): -take picture
E/CameraHardware( 1149): pmemheap: id = 27 base = 2bddc000
E/CameraHardware( 1149): pmem pool /dev/pmem_adsp ioctl(PMEM_GET_SIZE)
i
s 118784
E/CameraHardware( 1149): pmemheap: id = 29 base = 2bdfc000
E/CameraHardware( 1149): pmem pool /dev/pmem_adsp ioctl(PMEM_GET_SIZE)
i
s 118784
E/CameraHardware( 1149): pmemheap: id = 31 base = 2be1c000
E/CameraHardware( 1149): pmem pool /dev/pmem_adsp ioctl(PMEM_GET_SIZE)
i
s 118784
E/CameraHardware( 1149): pmemheap: id = 33 base = 2be3c000
E/CameraHardware( 1149): pmem pool /dev/pmem_adsp ioctl(PMEM_GET_SIZE)
i
s 118784
E/CameraHardware( 1149): hal_mmap #0 start = 2bddc000 end = 2bdf81ff
E/CameraHardware( 1149): hal_mmap #1 start = 2bdfc000 end = 2be181ff
E/CameraHardware( 1149): hal_mmap #2 start = 2be1c000 end = 2be381ff
E/CameraHardware( 1149): hal_mmap #3 start = 2be3c000 end = 2be581ff
E/CameraCool( 1970): in shutter callback
E/CameraHardware( 1149): native_get_picture: MSM_CAM_IOCTL_GET_PICTURE
f
ailed... ioctl return value is -1
E/CameraHardware( 1149): main:3071 getPicture failed!
E/CameraHardware( 1149): JPEG callback was cancelled--not encoding
image
.
E/CameraHardware( 1149):  LOCK ACQUIRED in receive jpegpicture
E/CameraHardware( 1149):  SIGNALLED QCS_IDLE in receivejpegpicture
E/CameraHardware( 1149):  SIGNALLED QCS_IDLE in receiverawpicture
E/CameraHardware( 1149): receiveRawPicture: X

This is snippet of my code:

mCamera = Camera.open();
mCamera.takePicture(shutterCallback, rawCallback, jpegCallback);

How to solve it? If someone knows the answer, please give me a hint.
Thanks a lot.
Adrian

-- 
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 use a Live Wallpaper in an Activity?

2010-02-04 Thread Jon Taylor
Hi,

I have created a small sample Live Wallpaper, and I want to use it
with a small test Activity I have also created.  However, I cannot
seem to find an example of how to do this.  The examples I have seen
on the Web and in the Android sources all seem to focus on creating
the live wallpaper itself, not how to link it to an Activity and
display it behind the activity with transparency, etc.  So far, all I
have is a Live Wallpaper service, with no idea how to go about using
it!  Does anyone know where I could find _all_ the steps to do this?

-- 
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 play a media file on emulator

2010-02-04 Thread Babasaheb
Hi,

I think this should help you..

http://groups.google.com/group/android-developers/browse_thread/
thread/c5e6135e6f9a242c

I had similar problem, I got my answer here, i.e. the problem is with
emulator.

Thanks

On Feb 4, 10:37 am, prachi prachi.tya...@wipro.com wrote:
 Hey hii all

 I hav a code to run a start a media player a play an audio file saved
 in my local disk.But the code is not running and it is showing an
 exception:

 PlayerDriver PVMFInfoErrorHandlingComplete

 Plzz help me out!!

-- 
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 show a message during incoming call?

2010-02-04 Thread roackalone
Hi,

How can I show a window containing few lines of text during the phone
ringing period? My app in running in background at this time.
Toasts won't work because  they last at most 4 seconds.

Thanks in Advance.

RA

-- 
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: Emulator on Ubuntu problem running after first time starting emulator

2010-02-04 Thread Richard Kasperowski
For me, this has been happening consistently on my Mac.  After running
it mostly successfully for weeks, today I can't get the emulator to
start successfully.

I haven't really looked through the qemud source code, but at
http://gitorious.org/0xdroid/external_qemu/blobs/3a0c4d9eed9ba76e2744258af212b8c1269a24a5/android/hw-qemud.c
I notice:

1228/* we don't expect clients of char. services to exit. Just
1229 * print an error to signal an unexpected situation. We should
1230 * be able to recover from these though, so don't panic.
1231 */
1232static void
1233_qemud_char_client_close( void*  opaque )
1234{
1235derror(unexpected qemud char. channel close);
1236}

Any ideas?





On Jan 28, 6:46 pm, David Turner di...@android.com wrote:
 This is an emulator bug that is unrelated to your application. I could never
 reproduce it but several people have reported it.
 Can you confirm that you have a 100% way to reproduce it ?



 On Thu, Jan 28, 2010 at 3:24 PM, Kevin Duffey andjar...@gmail.com wrote:
  Hi all,

  I've seen other posts on emulators, but none seem to match my issue.
  Basically on a clean boot of my Ubuntu 9.04 64-bit system, I fire up
  Eclipse, load my project, and run it in debug (or not) mode. Either way, the
  emulator fires up, takes about 30 to 45 seconds to initialize, and my app
  shows up. When I make some changes and rebuild my app, sometimes it reloads
  properly. However, if I shut down the emulator at all, then relaunch it
  fresh, I am constantly getting the following error in the console output:

  emulator: ERROR: unexpected qemud char. channel close

  Now, I run in DDMS perspective as well, and I see a bunch of threads start
  up. I also see my app being deployed. Then slowly, all the threads including
  the normal ones like Alarm clock, etc disappear. Then that error line shows
  up. At this point, my app somehow shows up in the emulator (it's a google
  maps app), and I have NOT had to press the menu key to get past the normal
  lock screen. Not sure why when this thing crashes like this, I've not had to
  use the lock screen menu press to see my app like I usually do.

  I've not found any useful info on the specific error either.

  Thank you for any 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.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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] Override Network TypeName

2010-02-04 Thread DroidAddict
Hello guys,

Is there a way to override the TypeName in NetworkInfo object.

The TypeName is set to WIFI when the WIFI connection is turned on. I
would like to override this TypeName from WIFI and set it to MOBILE.

I would like to know if this can be done on android with the exposed
set of API's. Any views on this is also appreciated.

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: How to get old version of android source

2010-02-04 Thread abukustfan
Hi,

Did you try below?
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b
android-1.6_r2


On Feb 4, 10:48 am, sheng wang banxia...@gmail.com wrote:
 Hi,

 According to the doc of  http://source.android.com/download

 *If you would like to check out a branch other than master, specify it
 with -b, like:*
 *$ repo init** -u git://android.git.kernel.org/platform/manifest.git -b
 cupcake*

 I need to download android source 1.6 which  match the android sdk 1.6, I
 guess the command should looks similar like above. Anyone can tell me what
 exactly it should be ?

 Thanks in advances.

 Shawn.

-- 
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


Re: [android-developers] Using Surface in the Native Code

2010-02-04 Thread Johann Koenig
On Wed, 3 Feb 2010 00:28:37 -0500
Sandeep Prakash 123sa...@gmail.com wrote:

 But the following ERROR occurs when we try to run the .apk.
 
 02-03 09:55:51.258: WARN/ServiceManager(582): Permission failure:
 android.permission.ACCESS_SURFACE_FLINGER from uid=10032 pid=1361
 02-03 09:55:51.258: ERROR/SurfaceFlinger(582): Permission Denial:
 can't access SurfaceFlinger pid=1361, uid=10032
 
 The I changed the permission for
 android.permission.ACCESS_SURFACE_FLINGER in frameworks/base/core/
 res/AndroidManifest.xml to dangerous and recompiled. But got the
 same error.
 
 Then I commented out the checkCallingPermission method in
 IServiceManager.cpp and recompiled. Then also i got the same error.

http://groups.google.com/group/android-porting/browse_thread/thread/6f649c42d30f7572

You can't use that permission unless your package is signed with the
same key as the system image.
-- 
-Johann Koenig

-- 
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] GridView.LayoutParameters()

2010-02-04 Thread vishu

what is the use of  setLayoutParams(new
GridView.LayoutParams(width,height))  in GridView with images
example..

Can anybody explain me about this .

Thanks in advance...

-- 
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] ObjectInputStream creation works in straight java, but fails on alternating calls inside Android

2010-02-04 Thread DanaH
Below is some test code that works fine when run from the command line
(it prints out a phone number five times).

However, when I run this same code from within my android app, it
fails on every other call to “getit()”.  Specifically, it fails on
this line:
  inStream = new ObjectInputStream ( url.openStream() );
with a java.io.StreamCorruptedException. I have checked for version
differences in the java sdk, but that checked out okay.

How can I further track down the source of this error, which is
apparently specific to the android environment?

DanaH

_

import java.net.*;
import java.io.*;
import java.util.*;
import java.beans.*;

public class discHashTest {

  public static void main ( String args[] ) {
discHashTest x = new discHashTest();
x.go ();
  }

  public discHashTest () {}

  public void go () {
URL url = null;

try {
  url = new URL ( MY_SERVLET_URL);
} catch (Exception e) {
  System.out.println ( Died trying to read );
  e.printStackTrace ();
}

getit ( url );
getit ( url );
getit ( url );
getit ( url );
getit ( url );

  }
  private void getit ( URL url ) {
ObjectInputStream inStream;
try {
  inStream = new ObjectInputStream ( url.openStream() );
  HashMap h = (HashMap) inStream.readObject();
  inStream.close();

  Vector v = (Vector) h.get ( LMRCH );
  HashMap h1 = (HashMap) v.elementAt ( 0 );
  System.out.println ( h1.get ( phone ) );

} catch (Exception e) {
  System.out.println ( Died trying to decipher );
  e.printStackTrace ();
}

  }

}
_

-- 
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: ListView not responding to Click or KeyPress

2010-02-04 Thread chboing
i have the exact same problem ...

i have an Activity that contains a Listview which is used in a Dialog
My ListView contains only TextViews. It's initialized in my own
baseAdapter. Built from a txt file on the sd card.
it's working nicely except the main goal for me, select one of those
item in the ListView :(

and same as Ted, in debugger mode, nothing happen when i click one
item, it doesnt go into the onItemClick method

anyone got an idea ? i lost some hours already on this ...

did you find anything new about this Ted ?



On 6 jan, 02:15, Ted ted.eker...@gmail.com wrote:
 Hey!
 I think I have the same problem, and I donothave any focusable
 children. My layout for a Row in the ListView contains:

 LinearLayout
    |
    +-- ImageView
    |
    +-- LinearLayout
            |
            +-- TextView
            |
            +-- TextView
            |
            +-- TextView

 and the Main activity is like this:

 code
 public class Main extends Activity
 {
         ArrayListNode nodes;

     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState)
     {
         requestWindowFeature(Window.FEATURE_NO_TITLE);
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);

         ArrayListNode nodes = new ArrayListNode();
         nodes.add(new Node(My name, My text, 13:10, 0));

         NodeRowAdapter nra = new NodeRowAdapter(this, nodes);

         ListView listView1 = (ListView) findViewById
 (R.id.ListViewNodes);
         listView1.setOnItemClickListener(newOnItemClickListener() {

                 public void onItemClick(AdapterView? parent, View view, int
 position, long id)
                 {
                         System.out.println (get onItem Click position=
 +position);
             }
                 });
         listView1.setAdapter(nra);
     }}

 /code

 It seems to me as nothing at all happens when I click the item in the
 ListView...

 On 4 Dec 2009, 19:43, Romain Guy romain...@android.com wrote:



  This is unnecessary. This problem will occur if your list item
  contains focusable children (like buttons, edittexts, etc.)

  On Thu, Dec 3, 2009 at 4:20 PM, hwii77 hwi...@gmail.com wrote:
   maybe maybe try this: Add android:clickable=true  (and
   android:focusable=true)

   On Dec 2, 1:37 pm, n179911 n179...@gmail.com wrote:
   Hi,

   I have a simple ListView in my layout.xml file.

       ListView android:id=@+id/action_list
               android:layout_width=fill_parent
               android:layout_height=wrap_content
           /

   And in my javacode, I add a setOnItemClickListener() to my listview:

   listView.setOnItemClickListener(newOnItemClickListener() {

                   public void onItemClick(AdapterView? parent, View view,
   int position, long id) {
                       System.out.println (get onItem Click position=
   +position);

                   }
               });

   But when I run on G1. I don't see any print out when I click an item on 
   the
   ListView on the phone.
   Or when I select an item using track ball and press CENTER.

   Can you please tell me why to resolve my problem?

   Thanks in advance.

   --
   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

  --
  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] Jumping effect of Status Bar

2010-02-04 Thread Kichch
Hi everybody

I have a problem with my app.  I use the full screen option like so:
 public void setFullscreen() {
   requestWindowFeature(Window.FEATURE_NO_TITLE);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
   WindowManager.LayoutParams.FLAG_FULLSCREEN);
 }

But, later during the game, when I show the AlertDialog for Help /
Info, the status bar comes back for a fraction of a second and
disappears again creating a flashing or jumping effect. Also, the
Dialog itself is not centered as it should, almost as if it thought
there was a status bar.

Here is how I display the dialog:

protected Dialog onCreateDialog(int id) {
TextView tv;

switch (id) {
case MENU_HELP:
   tv = new TextView(this);
   tv.setText(R.strings.help_msg);

   return new AlertDialog.Builder(BlackJackView.this)
   .setIcon(android.R.drawable.ic_menu_help)
   .setTitle(How-To)
   .setView(tv)
   .setPositiveButton(OK, new
DialogInterface.OnClickListener() {
   public void onClick(DialogInterface dialog, int
whichButton) {
/* User clicked OK so do some stuff */
   }
   })
   .create();
}

………

}
return null;
}

Does anyone know what may be causing this appearing / disappearing?
How do I make it stop this jumping behavior?

Thanks for all your 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] Add languages to arm-eabi-gcc

2010-02-04 Thread mikl
Dear Community,

By running
$DONUT_SRC/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
gcc --help
I get (among other things) Permissible languages include: c c++
assembler none.

Is it possible to include other languages like Fortran? I can't find
the source files to the toolchain such that I can modify the GCC-
configuration to include something like --enable-languages=c,c+
+,fortran .

Cheers, Mikkel.

-- 
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: btsocket connected but read zero bytes

2010-02-04 Thread Bwd
Good day.
I was able to create a stable connection to the BT device.
To do this, I changed your code:
BluetoothSocket btsocket =
btdev.createRfcommSocketToServiceRecord(uuid);
btsocket.connect();

Upon:
int RFCOMM_CHANEL = 1; //SPP chanel
Method m = btdev.getClass().getMethod(createRfcommSocket, new
Class[] { int.class });
BluetoothSocket connection = (BluetoothSocket) m.invoke(btdev,
RFCOMM_CHANEL);
connection.connect();

And now the connection has been stable and not broken and you can read
and receive data by input and output streams.


On 16 янв, 02:48, Sean Liao wirelessw...@gmail.com wrote:
 Anyone look into or experienced the same problem using the role switch
 feature?  I think this may be a bug on the android sdk:

 If android bt advertise it support role switch and it should fullfil the
 request from remote device.  Or, it should simply advertise that it doesn't
 support role switch so the remote device would not request role switch?

 is that how it suppose to work?  comments?

 On Mon, Nov 30, 2009 at 11:36 AM, Sean Liao wirelessw...@gmail.com wrote:
  We hooked up a BT protocol analyzer to monitor why connection getting
  dropped right after connection.  We are certain it is due to Role Switch.
   By disable role switch, I have successfully established connection, read
  and write.

  The behavior seems not right, and I think there may be a problem on my
  Android phones.  The following is what I observed from the protocol
  analyzer:

  1.  Android makes a connection to remote device. It is succesful.
  2.  Remote device requests Role Switch.
       =  Android must  response yes (I believe, otherwise, connection
  would just stay and no further steps shall take place)

  3.  Android immediately disconnects the above connection.
  4.  The remote device attempts to establish a connection to my Android
  phone, it fails.  I can see the remote device trying to negotiate connection
  rate but eventually giving up.

  The above I believe 3 and 4 are the steps when role switch taken place.  I
  could be wrong but by disable role switch on remote device, the connection
  is fairly robust.

  May I request role switch feature for next release?

  Best regards,
  Sean

  On Tue, Nov 24, 2009 at 12:45 PM, Sean Liao wirelessw...@gmail.comwrote:

  Hi, I wrote a simple test driver to test the bluetooth apis.  Anyone can
  verify whether I am using the API correctly?  Everything seems good but no
  data read :-(

  ===
  // before calling the following, inquiry scan successfully returned, and
  the remote device is pre-paired.

     private boolean doTestConnection() {

        Log.d(SwxBtCommImpl, doTestConnection);

        String btAddr = 00:08:1B:CA:C7:29;

        BluetoothDevice btdev =
  BluetoothAdapterImpl.getInstance().getRemoteDevice(btAddr);

        // widcom using the following GUID
        // 1101--1000-8000-00805F9B34FB
        UUID uuid = UUID.fromString(1101--1000-8000-00805F9B34FB);

        try {
           BluetoothSocket btsocket =
  btdev.createRfcommSocketToServiceRecord(uuid);

           btsocket.connect();
           Log.d(SwxBtCommImpl, connected);

           try {
              Thread.sleep(1000);
           } catch (InterruptedException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
           }

           InputStream instream = btsocket.getInputStream();
           Log.d(, getInputStream);

           byte[] data = new byte[512];
           for (int i = 0; i  20; i++) {
              int numOfAvailable = instream.available();

              Log.d(SwxBtCommImpl, read  + i + :  + numOfAvailable + 
  bytes);
              if(numOfAvailable  0) {
                 int numOfRead = instream.read(data);
                 Log.d(SwxBtCommImpl, new String(data) + - + numOfRead);
              } else {

                 try {
                    Thread.sleep(500);
                 } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                 }
              }
           }

           instream.close();
           instream = null;

           btsocket.close();

        } catch (IOException e) {
           // TODO Auto-generated catch block
           Log.e(, bt connection failed, e);
        }

        return true;
     }

-- 
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] Jumping effect of Status Bar

2010-02-04 Thread Kichch
Hi everybody

I have a problem with my app.  I use the full screen option like so:
  public void setFullscreen() {
requestWindowFeature(Window.FEATURE_NO_TITLE);
 
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
  }

But, later during the game, when I show the AlertDialog for Help /
Info, the status bar comes back for a fraction of a second and
disappears again creating a flashing or jumping effect. Also, the
Dialog itself is not centered as it should, almost as if it thought
there was a status bar.

Here is how I display the dialog:

protected Dialog onCreateDialog(int id) {
TextView tv;

switch (id) {
case MENU_HELP:
tv = new TextView(this);
tv.setText(R.strings.help_msg);

return new AlertDialog.Builder(BlackJackView.this)
.setIcon(android.R.drawable.ic_menu_help)
.setTitle(How-To)
.setView(tv)
.setPositiveButton(OK, new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {

/* User clicked OK so do some stuff */

}
})
.create();
}

………

}
return null;
}

Does anyone know what may be causing this appearing / disappearing?
How do I make it stop this jumping behavior?

Thanks for all your 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] sreadahead.c application is not compiling with android bionic library

2010-02-04 Thread zafar
Trying to use sreadahead tool on android target to decrease bootup
time .
But sreaahesd.c are not getting compiled against bionic library.
Below is the error message-




/tmp/ccIfKOOt.o: In function `one_thread':
/home/zafar/spreadahead/sreadahead-1.0/sreadahead.c:177: undefined
reference to `__sync_fetch_and_add_4'
/tmp/ccIfKOOt.o: In function `readahead_one':
/home/zafar/spreadahead/sreadahead-1.0/sreadahead.c:166: undefined
reference to `readahead'
/tmp/ccIfKOOt.o: In function `one_thread':
/home/zafar/spreadahead/sreadahead-1.0/sreadahead.c:177: undefined
reference to `__sync_fetch_and_add_4'
collect2: ld returned 1 exit status
make: *** [sreadahead] Error 1



Any help will be highly appreciated

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: FingerPaint application

2010-02-04 Thread varun
hi you can find the source code for finger paint in the api demos in
ur sdk
android-sdk-linux/platforms/android-2.1/samples/ApiDemos/src/com/
example/android/apis/graphics
in this folder you need to change just a sing line in the
FingerPaint.java

in the MyView class constructor change like this

public MyView(Context c) {
super(c);

//mBitmap = Bitmap.createBitmap(320, 480,
Bitmap.Config.ARGB_);
mBitmap = Bitmap.createBitmap(800, 480,
Bitmap.Config.ARGB_);
mCanvas = new Canvas(mBitmap);
mPath = new Path();
mBitmapPaint = new Paint(Paint.DITHER_FLAG);
}

-- 
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] SDK installation error - no buffer space available (maximum connections reached?): recv failed

2010-02-04 Thread Blair
I am trying to get my environment setup to develop an android app.
After unpacking the SDK files and running the SDK Setup.exe, the
Android SDK and AVD manager opens up.

I click on the AVAILABLE PACKAGES tab which is where the Android
manager actually downloads all the available resources including every
SDK Platform Android x.x and every Google API by Google Inc., API
x, revision x

There are green check marks in every check box, indicating that I need
to download every update. SO I click INSTALL SELECTED.

The INSTALLATION ARCHIVES box pops up and this is where I get stuck. I
receive the following errors and I'm not sure what to do from here..

Downloading Documentation for Android SDK, API 7, revision 1
No buffer space available (maximum connections reached?): recv
failed
Downloading SDK Platform Android 2.1, API 7, revision 1
No buffer space available (maximum connections reached?): recv
failed
Skipping 'Google APIs by Google Inc., Android API 7, revision 1';
it depends on 'SDK Platform Android 2.1, API 7, revision 1' which was
not installed.
Downloading Google APIs by Google Inc., Android API 7, revision 1
No buffer space available (maximum connections reached?): recv
failed
Downloading SDK Platform Android 2.0.1, API 6, revision 1
No buffer space available (maximum connections reached?): recv
failed
Skipping 'Google APIs by Google Inc., Android API 6, revision 1';
it depends on 'SDK Platform Android 2.0.1, API 6, revision 1' which
was not installed.
Downloading Google APIs by Google Inc., Android API 6, revision 1
No buffer space available (maximum connections reached?): recv
failed
Downloading SDK Platform Android 2.0, API 5, revision 1
No buffer space available (maximum connections reached?): recv
failed
Skipping 'Google APIs by Google Inc., Android API 5, revision 1';
it depends on 'SDK Platform Android 2.0, API 5, revision 1' which was
not installed.
Downloading Google APIs by Google Inc., Android API 5, revision 1
No buffer space available (maximum connections reached?): recv
failed
Downloading SDK Platform Android 1.6, API 4, revision 2
No buffer space available (maximum connections reached?): recv
failed
Skipping 'Google APIs by Google Inc., Android API 4, revision 2';
it depends on 'SDK Platform Android 1.6, API 4, revision 2' which was
not installed.
Downloading Google APIs by Google Inc., Android API 4, revision 2
No buffer space available (maximum connections reached?): recv
failed
Downloading SDK Platform Android 1.5, API 3, revision 3
No buffer space available (maximum connections reached?): recv
failed
Skipping 'Google APIs by Google Inc., Android API 3, revision 3';
it depends on 'SDK Platform Android 1.5, API 3, revision 3' which was
not installed.
Downloading Google APIs by Google Inc., Android API 3, revision 3
No buffer space available (maximum connections reached?): recv
failed
Downloading SDK Platform Android 1.1, API 2, revision 1
No buffer space available (maximum connections reached?): recv
failed
Downloading Usb Driver package, revision 3
No buffer space available (maximum connections reached?): recv
failed

I did some googling on No buffer space available (maximum connections
reached?) and apparently, it is a socket issue that typically occurs
when a database query is called and there are a large number of TCP
connections?  but I have no idea how to troubleshoot this problem.

And beyond that I'm completely stuck. Can't find anything on my issue
relating to Android SDK installation and I don't really know where to
turn to continue.

I was able to complete the install of all SDK components on another PC
while I have been troubleshooting this one, but unfortunately, I don't
have much time to develop on that other PC.

Next steps I guess I am wondering is it possible to download Android
SDK components without using the Android SDK management utility?

Any advice on next steps or troubleshooting my errors would be great.

Thank you,
Blair

-- 
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 get Context Menu and panning work together in an app.

2010-02-04 Thread newbie
Hi,

I am trying to write an app which has an ImageView and the app allows
to perform panning on the image. I also want to register context menu
with this ImageView so that on long press Context menu comes up. I
tried playing around with the onTouch method, but could not get it
working.

On long press, i do see context menu. But, while panning also the
context menu comes up. I want that context menu is displayed only when
long press is performed and not while panning. If I return true from
the down event, the context menu fails to come up.

Please find the snippet of the code below for the reference.

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

ImageView image = (ImageView) findViewById(R.id.image_id);
image.setOnTouchListener(this);
registerForContextMenu(image);
}

public boolean onTouch(View view, MotionEvent event)
{
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mXPos = event.getRawX();
mYPos = event.getRawY();
return false;
case MotionEvent.ACTION_MOVE:
float newXPos = event.getRawX();
float newYPos = event.getRawY();

view.scrollBy((int)(mXPos - newXPos), (int)(mYPos - 
newYPos));
mXPos = newXPos;
mYPos = newYPos;
return true;
case MotionEvent.ACTION_UP:
return false;

}
return false;
}

public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
menu.add(Menu.NONE, 0, Menu.NONE, Item1);
menu.add(Menu.NONE, 1, Menu.NONE, Item2);
}

private float mXPos, mYPos;

Thanks in Advance.

-- 
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] Background Intent

2010-02-04 Thread aalavandaan austin
Hi,

Is it possible to start an Intent but kepp it hidden? For example now
to start the intent I am using startActivitity(intent).
Suppose the intent is to start a web browser, the webbrowser is shown
to user. Is it possible to keep this hidden?

Regards.

-- 
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] Bug report for 2.0.1. Click on EditText.

2010-02-04 Thread OrSol
Put emulator  in landscape mode. Find EditText control in any
application (contacts for ex.) and press on it.
Application fails with exception:
02-04 17:27:55.434: ERROR/AndroidRuntime(802): Uncaught handler:
thread main exiting due to uncaught exception
02-04 17:27:55.474: ERROR/AndroidRuntime(802):
java.lang.IllegalArgumentException: width and height must be  0
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.graphics.Bitmap.nativeCreate(Native Method)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.graphics.Bitmap.createBitmap(Bitmap.java:468)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.inputmethodservice.KeyboardView.onBufferDraw(KeyboardView.java:
623)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.inputmethodservice.KeyboardView.onDraw(KeyboardView.java:614)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.View.draw(View.java:6536)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.drawChild(ViewGroup.java:1527)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1257)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.drawChild(ViewGroup.java:1525)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1257)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.drawChild(ViewGroup.java:1525)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1257)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.drawChild(ViewGroup.java:1525)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1257)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.drawChild(ViewGroup.java:1525)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1257)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.View.draw(View.java:6539)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.draw(PhoneWindow.java:1830)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewRoot.draw(ViewRoot.java:1349)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewRoot.performTraversals(ViewRoot.java:1114)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.os.Handler.dispatchMessage(Handler.java:99)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.os.Looper.loop(Looper.java:123)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
android.app.ActivityThread.main(ActivityThread.java:4338)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
java.lang.reflect.Method.invokeNative(Native Method)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
java.lang.reflect.Method.invoke(Method.java:521)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-04 17:27:55.474: ERROR/AndroidRuntime(802): at
dalvik.system.NativeStart.main(Native Method)

-- 
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] Preventing WakeLock Under-Locked exception

2010-02-04 Thread lipinski
I'm trying to implement a times WakeLock in my Application, so this is
not a Service.

I want the wakelock to simply prevent screen dimming for 3 min.
Looking through the docs, this seems simple enough, but I seem to
randomly encounter a Under-Locked exception that I cannot pinpoint.

Here is my WakeLock-related code:

in onCreate:
...
PowerManager pm = (PowerManager)
getSystemService(Context.POWER_SERVICE);
mWakeLock =
pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, TAG);
// Adjust time to include user's setting
int timeout = WAKELOCK_TIME -
Settings.System.getInt(getContentResolver(), SCREEN_OFF_TIMEOUT, 0);
if (timeout  0) {
mWakeLock.acquire(timeout);
}
...

in onDestroy:
if (mWakeLock != null  mWakeLock.isHeld() == true) {
try {
mWakeLock.release();
} catch (Exception e) {
// TODO Auto-generated catch block
//e.printStackTrace();
}

}
super.onDestroy();

As you can see, I wrap the release and try to only execute it when
necessary as a clean up only.  I'm assuming that since I'm aquiring
with a timeout, the PowerManager will handle the release in most cases
when the timeout expires.

I don't have a copy of the logcat at the moment, but what seems to
happen is I get the Under-Locked exception randomly, and at random
times (it's not always when WAKELOCK_TIME elapses).  The strange thing
is that the exception does not point to my code - all the entries
point to internal Android code.

It's hard to find examples of other people using aquire with timeouts.

Any ideas what I could be doing wrong here?

-- 
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] Textview with graphic (dynamically changing) inside.

2010-02-04 Thread John-Z80
Hello, I've a TextView that in the onCreate is build with an image to
the left from the static drawables, and with a text in the right.

I want to dynamically change the text and the image, (and maintain the
same image size), I have the image stored in a Bitmap named bm, (yes I
know I could change to a ImageButton and a textview but it has better
layout and I want to know if it's possible what I try to do, the way I
try)

I've tried different thing like:
Option 1:
TextView tv=(TextView)this.findViewById(R.id.TextView01);
BitmapDrawable bmd=new BitmapDrawable(bm);
tv.setCompoundDrawables(bmd.getCurrent(), null, null, null);
With this option the text remains inteact but NO image is draw...

Option 2:
the same but the end line is
tv.setBackgroundDrawable(bmd.getCurrent());
The Textview resizes to the image size and the image is draw and the
text is hidden by the image, not the desired behaviour... :-P

Option 3:
trying with canvas like:
Canvas can = new Canvas(bm);
Drawable d=tv.getBackground();
d.draw(can);
I got an exception so this is far from the solution...


Please any ideas of how can I achieve this?


-- 
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] btsocket stable connection

2010-02-04 Thread Bwd
Good day.
I was able to create a stable connection to the BT device.
To do this, I changed your code:
BluetoothSocket btsocket =
btdev.createRfcommSocketToServiceRecord(uuid);
btsocket.connect();

Upon:
int RFCOMM_CHANEL = 1; //SPP chanel
Method m = btdev.getClass().getMethod(createRfcommSocket, new
Class[] { int.class });
BluetoothSocket connection = (BluetoothSocket) m.invoke(btdev,
RFCOMM_CHANEL);
connection.connect();

And now the connection has been stable and not broken and you can read
and receive data by input and output streams.


-- 
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


Re: [android-developers] Re: options menu items

2010-02-04 Thread Sean Hodges
No, you cannot adjust the theme or layout of the default options menu
(see http://code.google.com/p/android/issues/detail?id=4441). However,
you can intercept the Menu button press and draw your own menu...


On Thu, Feb 4, 2010 at 4:25 PM, Robert Nekic robertne...@gmail.com wrote:
 I was about to start looking into this, too.  I have several items in
 a More menu and I would like to slightly adjust the height of each
 item.  I assumed I would discover a way to supply a layout definition
 for the menu items but this is not possible?



 On Feb 4, 10:38 am, skink psk...@gmail.com wrote:
 On Feb 4, 2:27 pm, manigault manig...@gmail.com wrote:

  Hi all,
  I want to customize option menu items. I can change icon when
  selecting using a selector but how can i change the text color during
  selection. If it was TextView i could use again selector for textColor
  property but for menu items there is only resource for textValue not
  for textColor. So my question is how can i change the textColor of
  MenuItems on selection.

 unfortunately, you can't

 pskink

 --
 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

-- 
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] unsubscribe

2010-02-04 Thread 林陈明
unsubscribe

-- 
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

Re: [android-developers] Re: options menu items

2010-02-04 Thread haric zhu
I think it is not possible currently, but you can right a dialog like List
Activity to do this, i mean customize it.

2010/2/5 Robert Nekic robertne...@gmail.com

 I was about to start looking into this, too.  I have several items in
 a More menu and I would like to slightly adjust the height of each
 item.  I assumed I would discover a way to supply a layout definition
 for the menu items but this is not possible?



 On Feb 4, 10:38 am, skink psk...@gmail.com wrote:
  On Feb 4, 2:27 pm, manigault manig...@gmail.com wrote:
 
   Hi all,
   I want to customize option menu items. I can change icon when
   selecting using a selector but how can i change the text color during
   selection. If it was TextView i could use again selector for textColor
   property but for menu items there is only resource for textValue not
   for textColor. So my question is how can i change the textColor of
   MenuItems on selection.
 
  unfortunately, you can't
 
  pskink

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Best Regards

Haric

-- 
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] porting ogre on Android

2010-02-04 Thread Geetha
Hi Folks,
 I am new to developing 3D graphics rendering on Android. I need help
to port OGRE on Android.

Thanks,
Geetha

-- 
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: btsocket connected but read zero bytes

2010-02-04 Thread Bwd
Good day.
I was able to create a stable connection to the BT device.
To do this, I changed your code:
BluetoothSocket btsocket =
btdev.createRfcommSocketToServiceRecord(uuid);
btsocket.connect();

Upon:
int RFCOMM_CHANEL = 1; //SPP chanel
Method m = btdev.getClass().getMethod(createRfcommSocket, new
Class[] { int.class });
BluetoothSocket connection = (BluetoothSocket) m.invoke(btdev,
RFCOMM_CHANEL);
connection.connect();

And now the connection has been stable and not broken and you can read
and receive data by input and output streams.


On 16 янв, 02:48, Sean Liao wirelessw...@gmail.com wrote:
 Anyone look into or experienced the same problem using the role switch
 feature?  I think this may be a bug on the android sdk:

 If android bt advertise it support role switch and it should fullfil the
 request from remote device.  Or, it should simply advertise that it doesn't
 support role switch so the remote device would not request role switch?

 is that how it suppose to work?  comments?

 On Mon, Nov 30, 2009 at 11:36 AM, Sean Liao wirelessw...@gmail.com wrote:
  We hooked up a BT protocol analyzer to monitor why connection getting
  dropped right after connection.  We are certain it is due to Role Switch.
   By disable role switch, I have successfully established connection, read
  and write.

  The behavior seems not right, and I think there may be a problem on my
  Android phones.  The following is what I observed from the protocol
  analyzer:

  1.  Android makes a connection to remote device. It is succesful.
  2.  Remote device requests Role Switch.
       =  Android must  response yes (I believe, otherwise, connection
  would just stay and no further steps shall take place)

  3.  Android immediately disconnects the above connection.
  4.  The remote device attempts to establish a connection to my Android
  phone, it fails.  I can see the remote device trying to negotiate connection
  rate but eventually giving up.

  The above I believe 3 and 4 are the steps when role switch taken place.  I
  could be wrong but by disable role switch on remote device, the connection
  is fairly robust.

  May I request role switch feature for next release?

  Best regards,
  Sean

  On Tue, Nov 24, 2009 at 12:45 PM, Sean Liao wirelessw...@gmail.comwrote:

  Hi, I wrote a simple test driver to test the bluetooth apis.  Anyone can
  verify whether I am using the API correctly?  Everything seems good but no
  data read :-(

  ===
  // before calling the following, inquiry scan successfully returned, and
  the remote device is pre-paired.

     private boolean doTestConnection() {

        Log.d(SwxBtCommImpl, doTestConnection);

        String btAddr = 00:08:1B:CA:C7:29;

        BluetoothDevice btdev =
  BluetoothAdapterImpl.getInstance().getRemoteDevice(btAddr);

        // widcom using the following GUID
        // 1101--1000-8000-00805F9B34FB
        UUID uuid = UUID.fromString(1101--1000-8000-00805F9B34FB);

        try {
           BluetoothSocket btsocket =
  btdev.createRfcommSocketToServiceRecord(uuid);

           btsocket.connect();
           Log.d(SwxBtCommImpl, connected);

           try {
              Thread.sleep(1000);
           } catch (InterruptedException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
           }

           InputStream instream = btsocket.getInputStream();
           Log.d(, getInputStream);

           byte[] data = new byte[512];
           for (int i = 0; i  20; i++) {
              int numOfAvailable = instream.available();

              Log.d(SwxBtCommImpl, read  + i + :  + numOfAvailable + 
  bytes);
              if(numOfAvailable  0) {
                 int numOfRead = instream.read(data);
                 Log.d(SwxBtCommImpl, new String(data) + - + numOfRead);
              } else {

                 try {
                    Thread.sleep(500);
                 } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                 }
              }
           }

           instream.close();
           instream = null;

           btsocket.close();

        } catch (IOException e) {
           // TODO Auto-generated catch block
           Log.e(, bt connection failed, e);
        }

        return true;
     }

-- 
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


Re: [android-developers] How to create executable file with linking static library?

2010-02-04 Thread Sachin Dole
On Feb 4, 2010 4:09 AM, bluestar bluestar8...@gmail.com wrote:

Dear Sir:

I have a static library: libhello.a and I want to create a
executable file that link with this
static library: libhello.a

I put this static library under
/out/target/product/generic/obj/STATIC_LIBRARIES/
libhello_intermediates/
and make my executable file, but failed

It shows error message:
make: *** No rule to make target `NOTICE-TARGET-STATIC_LIBRARIES-
libhello'.  Stop.

How to fix this issue? (Below is Android.mk of executable file)
Thanks!!!

//-//
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
LOCAL_SRC_FILES:= MyMain.c
LOCAL_SHARED_LIBRARIES := libcutils libc
LOCAL_STATIC_LIBRARIES := libhello
LOCAL_MODULE := myhello
include $(BUILD_EXECUTABLE)
//-//


BR,
Alan

--
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.comandroid-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

-- 
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   >