Sent from my Sony Ericsson Xperia.

"android-developers+nore...@googlegroups.com" 
<android-developers+nore...@googlegroups.com>编写:



  Today's Topic Summary

Group: http://groups.google.com/group/android-developers/topics

 *   Drawing on a canvas like normal VS OpenGl [2 Updates]
 *   Launching an application from a email. Is that possible? [1 Update]
 *   DNS WHOIS query support [2 Updates]
 *   First attempt at LVL Licensing [1 Update]
 *   About viewstubs [1 Update]
 *   How to stop ADB server [1 Update]
 *   What type of messaging would you use? [1 Update]
 *   HTTP parameter question [1 Update]
 *   Interaction with other apps [2 Updates]
 *   convert web page to pdf [2 Updates]
 *   How to access mail ? [2 Updates]
 *   "Use wireless networks" setting not always available? [1 Update]
 *   Can't Uninstall [1 Update]
 *   App Add-on [1 Update]
 *   Gingerbread BroadcastReceiver Issue [2 Updates]
 *   partial wakelock for 3G in Android [1 Update]
 *   Prevent application - after Factory Data reset [1 Update]
 *   Making cross-thread blocking/sync calls [1 Update]
 *   How to interrupt a blocking I/O operation? [1 Update]

 Topic: Drawing on a canvas like normal VS 
OpenGl<http://groups.google.com/group/android-developers/t/a441292fc2094c4e>

Tim <tdh...@gmail.com> Jan 08 04:52AM -0800 ^

> So I was just wondering is openGL better in terms of making a 2dgame. does
> it render faster then if I were to draw on a Canvas....

I would definitely go with OpenGL. I've not used the canvas, but I
seriously doubt it is as fast, and definitely isn't as flexible. It
may be easier to use though if your game is simple (e.g. I would use
it for something like a board game).

Also, using OpenGL will let you easily port your game to other OSes
(except WP7).



David Turner <di...@android.com> Jan 08 04:25PM +0100 ^


> So I was just wondering is openGL better in terms of making a 2dgame. does
> it render faster then if I were to draw on a Canvas....


It really depends on what you're doing.There are certain things that are
simply not possible or simply slower with OpenGL (e.g. high-quality
anti-aliased vector rendering being one of them). Also not all GLES
driver/chips are the same, and your performance may vary.

--



 Topic: Launching an application from a email. Is that 
possible?<http://groups.google.com/group/android-developers/t/c84ce967b77abc75>

sdphil <phil.pellouch...@gmail.com> Jan 08 07:12AM -0800 ^

okay, i finally got this to work, but it will only work if i use a
unique scheme. if I try to do it without a standard http scheme, then
i can't get it to work -- even if I specify mimeType.




 Topic: DNS WHOIS query 
support<http://groups.google.com/group/android-developers/t/d0ec6ef3ffd07aba>

"JAlexoid (Aleksandr Panzin)" <jalex...@gmail.com> Jan 08 06:58AM -0800 ^




"JAlexoid (Aleksandr Panzin)" <jalex...@gmail.com> Jan 08 07:07AM -0800 ^

http://www.dnsjava.org/ might help.

Though, how it works on Android I don't know....

Record [] records = new Lookup("android.com", Type.NS).run();
for (int i = 0; i < records.length; i++) {
MXRecord mx = (MXRecord) records[i];
System.out.println("Host " + mx.getTarget() + " has preference ",
mx.getPriority());
}





 Topic: First attempt at LVL 
Licensing<http://groups.google.com/group/android-developers/t/1699b73b26e2667b>

Neilz <neilhorn...@gmail.com> Jan 08 06:40AM -0800 ^

Hi all. I'm implementing this into my app and reading through the
docs.

As I understand it I should be able to add a test email address (the
one set up in my device) and it should return whatever response I set.
However, all I'm getting back is Application error: NOT_MARKET_MANAGED

Do I have to upload my app to the market for this to work? Currently
it isn't, but the docs seem to tell my that this isn't necessary for
test accounts.

Thanks.



 Topic: About 
viewstubs<http://groups.google.com/group/android-developers/t/e94c0c717d53c482>

Pedro Duque <pmdu...@gmail.com> Jan 08 02:34PM ^

I'm trying to gasp viewstubs but I feel I'm missing something.

As I understand, a viewstub only exists in a hierarchy until inflated
or until made visible. After that is replaced by its referenced
layout. This behaviour makes impossible to reinflate a inflated
viewstub. Is this correct?

The behaviour I was looking for was to have several buttons that would
open diferente viewstubs. When I click a button it would deflate the
previous layout and inflate the new one but this only works the first
time... After that the viewstub is gone...



 Topic: How to stop ADB 
server<http://groups.google.com/group/android-developers/t/e43f3d97256d178a>

Kumar Bibek <coomar....@gmail.com> Jan 08 06:20AM -0800 ^

What do you mean by dynamically? From inside an app? What would you
try to do that?

Anyway, to shut down the adb server, you just have to use this
commands

adb kill-server
adb start-server

These are command line tools available for you to interact with adb.




 Topic: What type of messaging would you 
use?<http://groups.google.com/group/android-developers/t/b0600155ad82d162>

Kumar Bibek <coomar....@gmail.com> Jan 08 06:17AM -0800 ^

Well, for reliable working, I think it would be best to use multiple
channels. SMS, cloud and local network(wireless or LAN), one of these
when the others are not available.




 Topic: HTTP parameter 
question<http://groups.google.com/group/android-developers/t/ce46f4c50f1c8992>

pedr0 <pulsarpie...@gmail.com> Jan 08 05:54AM -0800 ^

You could use a StringBuilder but is very simple build it yourself
without any help, I think.

See this for stringbuilder :http://www.javadb.com/using-the-
stringbuilder-class




 Topic: Interaction with other 
apps<http://groups.google.com/group/android-developers/t/b4b7c7e3aaca1fbd>

emafuma <emanue...@gmail.com> Jan 08 01:13AM -0800 ^

Hi, I'm investigating if I can make an app that runs in background but
is able to interact with others by "enriching" texts adding relevant
information. For instance, interact with an existent twitter app or
the mail app reading text and showing a popup with detected relevant
words. Is there a way to do so?
Thanks in advace for any help



Mark Murphy <mmur...@commonsware.com> Jan 08 08:32AM -0500 ^

> information. For instance, interact with an existent twitter app or
> the mail app reading text and showing a popup with detected relevant
> words. Is there a way to do so?

Fortunately no, as that would be a substantial security hole.

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

_The Busy Coder's Guide to Android Development_ Version 3.4 Available!



 Topic: convert web page to 
pdf<http://groups.google.com/group/android-developers/t/603158a4b6c2135e>

kavitha b <kkavith...@gmail.com> Jan 08 02:42PM +0530 ^

Hi All,

I have requirement in which I need to convert web page to pdf.

How to do this in android?

Please help.

Thanks
Kavitha



Mark Murphy <mmur...@commonsware.com> Jan 08 08:31AM -0500 ^

> I have requirement in which I need to convert web page to pdf.

Whoever gives you these requirements desperately needs to get a grip.

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

_The Busy Coder's Guide to Android Development_ Version 3.4 Available!



 Topic: How to access mail 
?<http://groups.google.com/group/android-developers/t/7aa1e15226fb15bc>

Bob Kerns <r...@acm.org> Jan 07 10:16PM -0800 ^


> You forgot the battery of permissions, one per email app, needed to
> give users control over what app/spyware can receive these broadcasts.
> Otherwise, though, you're probably on the right track tech-wise.

I didn't forget, but I did omit the issue to focus on the main point.
But you'll note that my suggested minimal protocol side-steps the
issue by not exposing anything about the email other than its arrival,
except via an optional content provider URL. That's where the
permissions would hook in.


> IMHO, it's a bit more complex than that. You are correct that the tech
> isn't the big problem. But anything that involves herding cats...er, I
> mean, developers...can never be described as "simply".

Actually, the cats in question here are already in a herd called the
Google Android Team. The real herding operation comes in when you try
to get developers of other applications to join in -- but it helps if
you already have a herd!

I've tried to do that herding on my own. From my perspective a lot of
the problem is not having a good communications framework and context
for proposing and discussing such proposals.

OpenIntents.org is a good start on that. I just checked on them, and
there's a lot more content and it's a lot easier to comment. It's
really important that these discussions occur in a visible place.
Email is NOT a good medium for this.

What you propose below is another approach to this -- unifying
applications in the face of non-standardization. It has its merits,
especially as a transitional measure. It is also an opportunity to
establish a defacto standard, especially if it publishes the best
protocol as an OpenIntents.org interface, and supports that well. New
apps (or old) which want to integrate well, could implement that
protocol.

But a bit of leadership from Google would really help here. For
example -- one VERY easy thing that the Google team could do is to
publicize OpenIntents.org here:

http://developer.android.com/intl/de/resources/community-groups.html




Mark Murphy <mmur...@commonsware.com> Jan 08 08:28AM -0500 ^

> issue by not exposing anything about the email other than its arrival,
> except via an optional content provider URL. That's where the
> permissions would hook in.

Off the cuff, I'd want the permissions even on the broadcasts, but
that might just be me.

> protocol as an OpenIntents.org interface, and supports that well. New
> apps (or old) which want to integrate well, could implement that
> protocol.

Nowadays, I run in that direction under the "my arms are too short to
box with Google" mindset I'm sporting.

> example -- one VERY easy thing that the Google team could do is to
> publicize OpenIntents.org here:

> http://developer.android.com/intl/de/resources/community-groups.html

I've been lobbying for this since 2008. If I can't convince them to
put a frakkin' hyperlink on a Web page, there's no way in hell that
I'm going to convince them to standardize APIs for calendar, email,
etc. As I said, "my arms are too short to box with Google".

That's why I see the only hope in being a community-led approach:

-- Create an API (e.g., email)
-- Convince third-party app developers (e.g., K9) to implement said
API, probably by helping them design the API in the first place
-- Create a wrapper that uses all sorts of nasty techniques to graft
that API on top of what's in Android today (e.g., Email app,
device-specific email clients)
-- Pray for a groundswell of apps using said API
-- Much later, after this stuff becomes popular, try to contribute
patches back to AOSP to put the API officially on this stuff, so we
can get rid of (or at least shrink) the wrapper

However, the kernel of all that is somebody with the itch to scratch.
Right now, I don't have the itch to standardize email, calendar, etc.
APIs. At most, I have the meta-itch of figuring out a process by which
we can collectively get stuff like that done. I'm with you, in that I
think Android is a more powerful platform with these sorts of things
in place. However, my plate overfloweth, and I have lots of windmills
to tilt at, to mix metaphors.

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

_The Busy Coder's Guide to Android Development_ Version 3.4 Available!



 Topic: "Use wireless networks" setting not always 
available?<http://groups.google.com/group/android-developers/t/88a2f6c4e619e960>

michael <michael.d.peder...@googlemail.com> Jan 08 05:16AM -0800 ^

Hello,

I have an app that relies on wireless network location, i.e. which
receives location updates from the NETWORK provider. In order for this
to work, the phone must have "Use wireless networks" enabled under the
"Location & security" settings, and my app instructs the user on how
to enable this.

However, it turns out that some phones (e.g. on certain American
carriers) don't have this setting at all. Instead they have two
settings:

"VZW location services" and
"Google location services"

My questions:

1) Am I correct in assuming that the first of these refers to mobile
network location, and the second to Wi-Fi network location?

2) How can my app detect whether the phone has the single "Use
wireless networks" option, or if it has both of the above mentioned
options? I imagine that the naming of "VZW location services" is
carrier-specific -- is there any way of obtaining the name of this
option programatically so I can provide appropriate instructions to my
users, ideally localised to the user's language?

3) If the phone has both settings, how can I detect which ones are
enabled? In other words, what is the return value of
LocationManager.isProviderEnabled("NETWORK") if e.g. only "VZW
location services" is enabled and not "Google location services"?

Any pointers would be greatly appreciated.

Best,
Michael.



 Topic: Can't 
Uninstall<http://groups.google.com/group/android-developers/t/948801201f27bb6c>

nextgen <nextgenfant...@comcast.net> Jan 08 04:57AM -0800 ^

Not the same package name. By keywords, I mean that they look for the
app using the Market App Search function and find ours at the top of
the list with a very similar name, so they assume it's the same.




 Topic: App 
Add-on<http://groups.google.com/group/android-developers/t/20745373a3e3f80d>

Brill Pappin <br...@pappin.ca> Jan 08 01:29AM -0800 ^

First, let me point you at this RFE:
http://www.google.com/support/forum/p/Android+Market/thread?fid=2d69022f36ab6f460004994e8be08b82&hl=en


I've noticed the LVL library has (and talks about) using a double
license check.
You could actually use this kind of pattern to add license levels to
your app in the way your talking about doing. The consumers act of
buying and installing would flag a feature in your db.

I've also been considering another approach where your main app would
look up features in a content provider. This has the advantage that if
the enabling app was uninstalled, you would no longer be able to
access the new features. Also, your users would not get duplicate
icons in their launcher if you don't provide a main activity.

- Brill Pappin





 Topic: Gingerbread BroadcastReceiver 
Issue<http://groups.google.com/group/android-developers/t/d87fb390c13d141d>

Jake Basile <jakerbas...@gmail.com> Jan 07 11:03PM -0800 ^

I assumed it would get killed and attempted to design around that so that it
gets restarted. I return START_STICKY onStartCommand, which I interpreted as
meaning it will be restarted after it is killed. Is that incorrect? What can
be returned from onStartCommand that can cause onDestroy() to not be called?



Dianne Hackborn <hack...@android.com> Jan 08 12:11AM -0800 ^

Yes then it will restart. You may want to have a look at the log when it
goes away to see if anything interesting is printed. Also "adb shell
dumpsys activity services" well tell you the state of currently active
services (even if their process isn't running).

Oh also check for crashing. If a service's process crashes a few times, the
services in it will be force removed.


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

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



 Topic: partial wakelock for 3G in 
Android<http://groups.google.com/group/android-developers/t/c04507a80d693263>

Tabman <tabishfay...@gmail.com> Jan 08 12:04AM -0800 ^

Hello,

Anyone from android development team confirm the answer to this:
http://stackoverflow.com/questions/4628058/partial-wakelock-for-3g-in-android/

Thanks



 Topic: Prevent application - after Factory Data 
reset<http://groups.google.com/group/android-developers/t/d0470e346ed14963>

Bob Kerns <r...@acm.org> Jan 07 11:51PM -0800 ^

Be nice to your users, making your application such an integral part
of their lives that they would never DREAM of doing a factory reset --
for fear of losing your app and ruining their lives forever.

Other than that, if you're an IT department wanting to make sure your
corporate apps aren't lost on a reset (and enabling a reset as a way
to wipe it for either support purposes or to reassign the device): Do
what Mark said -- become your own factory, and put together your own
firmware. One approach to this is through the Android Kitchen at
modaco.com, the paid version of which lets you upload files to include
into the final generated build.

It doesn't look all that hard to put together a custom build from a
stock one, but I've never tried. You'll need a modified recovery that
allows you to install unsigned releases -- and you'll lose the ability
to update the OS over the air, which might negate any support benefit
you thought you might get. On the other hand, you might consider that
a feature!

I guess there's also the negative strategy -- make it clear you'll
make their lives miserable if they do a factory reset! But I've never
found persuading users NOT to do something works very well.




 Topic: Making cross-thread blocking/sync 
calls<http://groups.google.com/group/android-developers/t/8cbf33153cd855d4>

Bob Kerns <r...@acm.org> Jan 07 11:37PM -0800 ^

Assuming there may actually be data to be transferred (or you invent
some), you can use an ArrayBlockingQueue.

Otherwise, wait()/notify() is a good choice, but you need to be
careful to handle the case that the UI thread does the notify before
you get into the wait() code. The usage pattern should be:

UI thread code: {
synchronized (mySyncObject) {
<set a flag saying UI is done>
mySyncObject.notifyAll();
}
}

Background thread code: {
<post request to the UI thread>
synchronized (mySyncObject) {
while (! <flag saying UI is done>) {
try {
mySyncObject.wait();
} catch (InterruptedException ex) {
// Ignore this even if we get it.
}
}
}
}

That's a while loop, not an if, because the wait() call can in theory
be interrupted (and you have to catch the InterruptedException).

Memorize this pattern! If you're using notify/wait, it should ALWAYS
look something like this.





 Topic: How to interrupt a blocking I/O 
operation?<http://groups.google.com/group/android-developers/t/bbefa403e19546d8>

Bob Kerns <r...@acm.org> Jan 07 10:48PM -0800 ^

Tabman's answer might possibly be what you're looking for -- but the
more general answer I'd give would be:

"You can't, and you generally don't need to. What are you really
trying to do?" Most of the times that people think they want to abort
waiting IO, that's really not what they need. It's usually sufficient
to indicate that the loop that was processing the data that its job is
done.

Aborting actual IO calls is an iffy thing on all platforms I've ever
used. (Note I'm talking about real-world behavior here; some APIs do
document a well-defined abort operation). I've done all manner of
asynchronous and threaded IO over many decades, but very, very seldom
have I needed to abort a pending IO operation. In fact, I may never
have encountered a need to do so.

Timeouts are often important, but aborting a pending I/O operation
implies you don't really care whether it succeeded or failed (as
that's a race condition), and yet you have a need for terminating the
I/O operation too urgent for a timeout. The need for urgent
cancellation I have a hard time justifying.




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

Reply via email to