[android-developers] How to track memory consumption? (Bitmaps)

2009-03-26 Thread Markus Junginger

How can one track memory consumption in Android? The Android "Heap"
view in Eclipse and java.lang.Runtime methods seem failing for my
purpose.

I tried to figure out how much memory my app consumes in order to make
decisions for future directions. Most of the memory goes into Bitmap
objects. Just to test memory consumption I created huge bitmaps in a
Loop and logged the java.lang.Runtime memory values:
created bitmap (610k free, 2371k total, 16384k max)
created bitmap (615k free, 2371k total, 16384k max)
created bitmap (615k free, 2371k total, 16384k max)
created bitmap (615k free, 2371k total, 16384k max)

Nothing seems to hapen, but on the fifth Bitmap:
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:343)
at de.greenrobot.colorball.GameView.init(GameView.java:86)

This seems confusing at first. Is java.lang.Runtime the right place to
check application memory stats in Android at all? Are Bitmaps
allocated outside the app's heap? How can I track it?

Thanks
Markus

--
http://greenrobot.de
http://jars.de

--~--~-~--~~~---~--~~
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 track memory consumption? (Bitmaps)

2009-03-27 Thread Markus Junginger

Thanks Michael for your reply.

On Mar 27, 12:07 am, Michael MacDonald 
wrote:
> AFAIK, bitmaps *are* created outside the Java heap, and there is a limit
> of 16MB imposed on the *sum* of the Java heap and the total of the
> allocated bitmaps.
So, does this mean, that there is currently no instrumentation for a
reliable memory tracking in Android as of today? If the sum of Java
and "native" heap counts, it would very helpful to have this value
accessible. From another viewpoint one could say the jav.lang.Runtime
memory stats are buggy because they do not count all resources. Which
leads to the next question: which resources are invisible to the
memory stats? I bet all media resources fall in this category.


> I don't know what you can look at to tell exactly how big the bitmap is,
> but I think they are essentially the size you think they would be: i.e.,
> 4 bytes per pixel for 24-bit color 8-bit alpha.
Yup, trying to approximate it yourself seems the only option left. :\

In my test case each Bitmap was around 2.4 MB (1664x768 16 bit, no
alpha). On the fifth, when it crashed, it sums up to 12 MB. The
java.lang.Runtime stats say that 2 MB are allocated by Java objects.
So another ~2MB are missing. This may make sense, because at that
point the app holds other resources as well. It does not sum up to 2
MB (only ~1 MB), but there may be memory fragmentation issues as well.

Nevertheless, I would really appreciate a reliable memory
instrumentation. Especially when one needs to debug when theory and
practice do not fit together nicely like in my test case.
--~--~-~--~~~---~--~~
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: The problem about the sensor!!!

2009-03-27 Thread Markus Junginger

I can confirm this issue. Since I switched from portrait to landscape,
the sensor values are messed up *sometimes* (swapped) and then I need
to restart the app!
Did we miss something or are the sensor values buggy in landscape
mode?

--~--~-~--~~~---~--~~
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: The problem about the sensor!!!

2009-03-27 Thread Markus Junginger

Reading the bold docs in upper case is always good. :) I did not
remember this info, and it's working as expected. Thanks!

BUT: I use a *fixed* landscape orientation, so the orientation should
not change. On the screen it does not when opening the keyboard, but
if the sensor does it seems more like a bug to me. At least it's a
pretty weird behaviour and I cannot make up a use case where it would
make sense.
--~--~-~--~~~---~--~~
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: The problem about the sensor!!!

2009-03-27 Thread Markus Junginger

On Mar 27, 11:11 am, Lukasz M  wrote:
> I had the same problem.
> I fixed it using a static sensor-reading object. Therefore while
> changing between activities sensors didnt swap.
But what happens when you start the app with the keyboard open?
Wouldn't you have swapped values then?

I think using the raw sensor values ([3], [4], and [5]) should be
better.

Oh, there's probably a problem using the raw values in the future: I
guess they will be swapped on devices that will come with a landscape
format screen, like the Kogan device.

So we have the choice if our app breaks now or later... ;)

Does anyone know how the orientation sensor sensor works in cupcake?
Does it handle a fixed orientation correctly?



--~--~-~--~~~---~--~~
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: Anything on Android that can do smooth scrolling?

2009-03-27 Thread Markus Junginger

I strongly agree with the idea that foreground processes should be
preferred. Currently I develop a game, which - like most games -
relies on a constant high frame rate. At first, the game pretty sloppy
until I realized some background app was draining CPU resources. So I
uninstalled some of them until it ran smoothly. Clearly, this is
nothing you want to tell a user to do.

So, my first thought on how to solve this is a guaranteed CPU slice
for the foreground app. Let the foreground task constantly get 90-95%
of the CPU time if it needs it, no matter what's running in the
background. The remaining 5-10% should be enough for background tasks.
I think that's perfectly fine if, for example, emails are received a
little slower when the user plays a game. Of course, if the foreground
task does not use the CPU entirely, background tasks should be able to
get a bigger slice.

Oh, and by the way, what about a JIT or a hotspot compiler? If Android
apps would be running a factor ~10 the problem would be smaller by the
same factor. :)
--~--~-~--~~~---~--~~
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: OutofMemory exception when dealing with large Bitmaps

2009-03-29 Thread Markus Junginger

On Mar 27, 5:10 pm, mark.ka...@gmail.com wrote:
>    This is a common problem when using the BimapFactory.decode, there
> is a bug or memory leak. We've had lengthy discussions about this in
> previous threads. Using smaller bitmaps, using bitmap.recycle(), and
> turning down the sample size can mitigate, but not eliminate this
> problem.

I use BitmapFactory a lot for all sizes of bitmaps (e.g. 2 mega
pixels) and I am not aware of any problems with it. I remember a
similar discussion here where Romain wrote he's sure it's not
BitmapFactory bug. So I am curious about this issue.

Btw, I think if you rotate a 1MP image, I would not be surprised if it
takes more than 10M of memory. The internal bitmap during rotation
might be bigger (> 2MP), especially at 45 degrees.

If 16 bits per pixel is OK in terms of quality: they just need half
the memory.

Markus

--
http://greenrobot.de

--~--~-~--~~~---~--~~
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: Scrollable area like in Robo Defense game(both horizontal and vertical)

2009-08-19 Thread Markus Junginger

I'm in the same boat and need a custom ScrollView capable of scrolling
in both directions. Before I start it on my own, I wanted to check
here first. This has probably done before a couple of times and maybe
someone does not mind sharing some code?

Anyone knows if Donut is going to support scrolling in both
directions?

Thanks,
Markus
--~--~-~--~~~---~--~~
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: Scrollable area like in Robo Defense game(both horizontal and vertical)

2009-08-19 Thread Markus Junginger

On Aug 20, 2:26 am, Dan Sherman  wrote:
> I would imagine that robo defence is doing custom scrolling within their
> application, and not relying on a UI component for that piece.

They must use there own custom UI component because it's not supported
by Android 1.5. Most games won't scroll any child views but will
implement a single game View and handle scrolling "just" for this
view. At least that's how I do it.

Nevertheless, what I was looking for is view something else. To
clarify my requirements a little more: there is just a fixed size View
which is larger than the screen and you need to scroll that and its
child views in both directions. I hope someone shares his/her
solution.
--~--~-~--~~~---~--~~
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: WebKit capabilities

2009-09-16 Thread Markus Junginger

I am also very interested in some Android specific documentation for
Android's WebKit. Just read a post from January that touch events are
not supported in JavaScript, which are available on the iPhone. What
about, for example, orientation events? Anyway, a clear reference for
WebKits' (Chrome's) capabilities seems to be missing in the Android
documentation.

Btw, I would love to see jQTouch on Android, so I hope David gets some
help.

Thanks,
Markus
--~--~-~--~~~---~--~~
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] Proxy support not working in Android 1.6 emulator

2009-09-17 Thread Markus Junginger

After upgrading to SDK 1.6 the emulator seems to be unable the
Internet through a proxy (-http-proxy option). The same is working in
SDK 1.5R3.

Can anyone confirm? Did I miss something?

Thanks
Markus

--~--~-~--~~~---~--~~
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] OutOfMemory with 9M free heap because of bitmaps!?

2010-03-03 Thread Markus Junginger
Our app has some memory peaks, which let the heap grow to 13M. After
the peak, there's 9M of free heap. Everything's fine until Bitmap
objects come into play. Despite having 9M of free heap creating
Bitmaps, which have only some 100k, now fail with a
OutOfMemoryException!

My theory: Allocation fails if (Java) heap *size* plus external
allocations (e.g. Bitmaps) exceed 16M, no matter that there is lots of
free memory in the heap. The VM could shrink the heap, but actually
does not. Would be quite a flaw in the VM.

Does anyone share this theory?

On the downside of this theory: I do not see anything appropriate
(killing the process is probably not) an app developer could do to
prevent those OutOfMemoryExceptions given that those memory peaks are
legitimate and unavoidable.

Please share your knowledge & thoughts!

Thanks,
Markus

-- 
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: OutOfMemory with 9M free heap because of bitmaps!?

2010-03-03 Thread Markus Junginger
On 3 Mrz., 23:01, Streets Of Boston  wrote:
> Yes, you're right.
I hope I am not, let's see...

> The OOM exception is thrown if your process' memory would exceed
> 16MByte (or 24MByte on some phones). This includes non-JVM memory such
> as raw bitmap-data.
That's the easy part.

> You may have 9MByte available in the java-heap,
> but if your process is still holding on to almost 7MByte of bitmap-
> data memory (which is not part of the java heap), you'll get an OOM
> when trying to allocate more memory.
This is getting confusing, let me go back to the example to see if we
are on the same track.

If the heap size is 13M of which 9M are free, it makes 4M of occupied
heap. In theory, that would make a potential 12M for external
allocations (given a 16M limit). My guess is that instead of the 12M
only 3M are actually available on Dalvik. That is, thee potentially
free 9M inside the Dalvik VM heap cannot be used for external
allocations, and Dalvik does not seem to make any attempts to shrink
its heap size.

Again, these are just my interpretations of what's going on. In the
app there are not even huge bitmaps involved, nor a big number of
them. There's a Bitmap cache involved storing in memory with
SoftReferences as a 1st level and storing to files as a 2nd level
cache. I checked for leaks with Eclipse Memory Analyzer without
finding any.

> Also, if i'm not mistaken, the DalvikVM's garbage collector is non-
> compacting.
Which would not make it easier... :/

-- 
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: OutOfMemory with 9M free heap because of bitmaps!?

2010-03-03 Thread Markus Junginger
> catch( Exception e )
> {
>   System.gc();
>   bm = BitmapFactory.decodeResource( resources, R.drawable.my_bm );
>
> }
>
> I know it's not the prettiest, but I've never seen the second attempt
> (after GC) fail.

Interesting. So, what you are saying is that Dalvik's GC does not a
good job freeing memory on its own?

I'll try if this work around makes it any better. However it is
limited because some of the Bitmaps get loaded during initialization
of layouts, where you can hardly interact. Hmm, a try/catch around
each setContentView also? Boy, this is getting ugly... ;)

-- 
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: OutOfMemory with 9M free heap because of bitmaps!?

2010-03-03 Thread Markus Junginger
Thanks guys for all of your replies so far!

> I'm not entirely comfortable with that generalization.  The HeapWorker
> thread wakes up during idle moments and looks for 4K pages with
> nothing in them.  When it finds them, the memory is made available to
> the system again (madvise() system call).
I have not been able to see the heap size shrink yet. Is there any way
(directly or indirectly) to trigger the HeapWorker manually?

> As currently implemented the pixel memory isn't discarded until the
> Bitmap finalizers execute, and finalizers can't run until after the GC
> has finished doing its thing, which is why sometimes allocating a
> bitmap twice in a row succeeds when the first try fails.
What you did not refer to is the tons of free memory in the virtual
heap in my situation, which is the essential point I wanted to make.
So, can you confirm that free memory in the heap is completely
irrelevant (HeapWorker is not triggered, etc.) when trying to allocate
external resources?

Back to the external allocation: I guess calling gc+runFinalization
does not make a difference compared to just gc?

In the end, I do not think running gc to help Dalvik cleaning up the
external allocations won't make much of a difference in my app. With a
steadily growing virtual heap (with tons of free sections in it), the
space for external allocations decreases over time.

> The external alloc stuff is also getting fixed (veterinarian-style) by
> the aforementioned GC people.
At least there's light at the end of the tunnel. :) Can you hint at a
specific release when this will be improved?

Thanks,
Markus

-- 
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: OutOfMemory with 9M free heap because of bitmaps!?

2010-03-04 Thread Markus Junginger
Btw, how do SQLite databases fit in here? Does SQLite run inside an
app's process and does it consume memory from the "external
allocation" space? Does it have limits in memory allocation or will it
just grab any memory it can make use of?

(The app I wrote about earlier does not use SQLite, I was just
wondering generally.)

-- 
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] Secure data storage (rooted phones)

2009-07-20 Thread Markus Junginger

Hello everyone,

Let's say there are hard security requirements that must include the
possibility of rooting a phone. So when a phone gets lost, the
sensitive data on it should still be as secure as possible even if the
phone is rooted.

Any hints and ideas on this?

The first thought was that one could generate a key based on some
device/user ID, but this information is available to all applications.
So given some reverse engineering and effort, this can be cracked too.

I am not exactly a security expert, but maybe there are some around
here in this group.

Thanks for all comments!

Regards,
Markus




--~--~-~--~~~---~--~~
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: Secure data storage (rooted phones)

2009-07-20 Thread Markus Junginger

Time and resources are limited, of course. :)

To further clarify the objective: a single file should be encrypted.
The other important point is, that there should be no user interaction
like password entry.

Given this, I guess a secure solution is impossible on rooted phones
in a strict sense (again, I am no security expert) because you can
reverse engineer code and access all data. The question is if there
are means to increase security to a level that makes significantly
harder for attackers while spending only a reasonable effort.

For example, I have heard of Keychain, which Developers can use on
MacOS X and iPhone to store data securely, but I do not know how it
works and how secure it actually is.

Any feedback and ideas are welcome!

Thanks,
Markus
--~--~-~--~~~---~--~~
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 add a calendar entry?

2009-01-27 Thread Markus Junginger

I would like to insert a new event (start time, end time, and event
name) in the user's calendar. How can I do that? I have the
impression, that the SDK does not have the API for it (yet), but the
G1 has the APIs. Would the CalendarProvider class the way to go?

See also: http://code.google.com/p/android/issues/detail?id=1389
Did anyone succeed in adding an event to the calendar?

Thanks!
Markus
--
http://jars.de
--~--~-~--~~~---~--~~
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 add a calendar entry?

2009-02-05 Thread Markus Junginger

For my purpose, I resolved it partly using a different approach. There
seems to be an undocumented Intent to bring up the Calendar UI and
fill start and end time in advance. I found out that the ZXing Apps
does it like this. Maybe this helps:
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("beginTime", start.getTime());
intent.putExtra("endTime", end.getTime());
intent.putExtra("summary", summary);
context.startActivity(intent);

One thing I did not find out was how to prepare the event name.
Setting the summary like in the code had no effect on my G1. If
somebody finds out, I would be happy to know...

Markus
--
http://jars.de

--~--~-~--~~~---~--~~
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] Sensors: Does orientation depend on acceleration?

2009-02-07 Thread Markus Junginger

I played around with the G1 sensors a bit and my impression was that
the orientation and the gravity sensor relate. Maybe the orientation
"sensor" even just uses the acceleration data to calculate the
orientation?

What led me to this question: when you try keep the device in the same
orientation and move/shake it, the orientation values are very much
affected.

Thanks,
Markus

--
http://jars.de
--~--~-~--~~~---~--~~
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] Voice Recognition like in Voice Search? (STT)

2009-02-09 Thread Markus Junginger

Voice Search is new with RC33. I am wondering if the voice recognition
will be part of the API 1.1. Or at least an Intent?

Btw, is the SDK 1.1 JavaDoc available somewhere yet?

Regards,
Markus

--
http://jars.de

--~--~-~--~~~---~--~~
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: Voice Recognition like in Voice Search? (STT)

2009-02-10 Thread Markus Junginger

On Feb 10, 5:53 am, "sscalp...@gmail.com"  wrote:
> The package android.speech.srec is in the master SDK.  It's documented
> as a simple, synchronous SREC speech recognition API.

Where do I find information on the "master SDK"?
There's no JavaDoc in the SDK 1.1 of this package. Maybe there is an
Intent though?
--~--~-~--~~~---~--~~
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: Voice Recognition like in Voice Search? (STT)

2009-02-10 Thread Markus Junginger

Thanks alot. I will look into 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: Voice Recognition like in Voice Search? (STT)

2009-02-11 Thread Markus Junginger

Future APIs are one thing, using Intents to access existing
functionality is another, imho. Voice search is already here, so the
question for me is if there are Intents to start the voice recognition
Activity and work on with the results. Thank Intents and loose
coupling. :)

For my purpose voice recognition would be optional - even if it would
break in a future release it would be fine. I would put a try&catch
around it anyway.

Would this approach (if possible at all) be OK for you?

Thanks,
Markus

--
http://jars.de

--~--~-~--~~~---~--~~
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: sound effect using SoundPool

2009-02-13 Thread Markus Junginger


On Feb 13, 9:04 am, Stoyan Damov  wrote:
> Listen to Robert's advice, and most importantly, if you don't have a
> need to manipulate the sounds during the game (e.g. Robert changes the
> pitch dynamically in his game) ...

How does Robert implement pitching? Is there a recommended lib?
A nice sound fx lib?

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



[android-developers] Re: How to add a calendar entry?

2009-02-19 Thread Markus Junginger

> Did anyone find a solution to this? Markus, did you find out how to set the
> event name??
No, no progress here. Is the source code of the calendar app available
git? It might be worth a look.
--~--~-~--~~~---~--~~
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] Broken after update: FileNotFoundException on openFileOutput

2009-02-20 Thread Markus Junginger

In the Android Market, I saw that users of my app had serious
problems:
http://www.cyrket.com/package/de.jars.android.quicksearch

After updating to a new version from the Market, the app became
unusable. This line is causing the trouble:
FileOutputStream fileOut = context.openFileOutput("searches",
Context.MODE_PRIVATE);

Exception stack:
java.io.FileNotFoundException: /data/data/de.jars.android.quicksearch/
files/searches
 at org.apache.harmony.luni.platform.OSFileSystem.open
(OSFileSystem.java:227)
 at java.io.FileOutputStream.(FileOutputStream.java:97)
 at android.app.ApplicationContext.openFileOutput
(ApplicationContext.java:364)
 at android.content.ContextWrapper.openFileOutput(ContextWrapper.java:
146)

I do not see a reason for a FileNotFoundException here - is it a
Android bug?

"/data/data" seems strange, too (should it not be just "/data"?).

Quick help would be nice; the less frustrated users, the better... ;)

Thanks a lot!
Markus
--~--~-~--~~~---~--~~
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: Broken after update: FileNotFoundException on openFileOutput

2009-02-20 Thread Markus Junginger

I just added some logging for debugging:
 File fileFile = context.getFileStreamPath(file);
 CommonLog.i("Opening file for output: " + fileFile.getAbsolutePath()
+ ", exists: " + fileFile.exists());

The output shows that the file exists:
Opening file for output: /data/data/de.jars.android.quicksearch/files/
searches, exists: true

So the file is there... Maybe it is a permission issue? Is my app not
allowed to access a file that it created in a previous version?? Would
not make sense to me, but I still do not know what is going on..

--~--~-~--~~~---~--~~
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: Broken after update: FileNotFoundException on openFileOutput

2009-02-20 Thread Markus Junginger

This is getting even more confusing:
 * canRead and canWrite are true on the file
 * creating new files (new names) also fails

The only way to get it to work again is to uninstall and install the
app from scratch again.

So, right know I am totally clueless, expect it could be an Android
bug. I noticed other apps in the market having similar problems
("please uninstall and install"). But on the other hand, a bug of that
severity would probably have been popped up and fixed earlier. So, I
am hoping I missed something important here, or at least that there's
work around.

Any ideas? Does it work with your app? Any help is highly appreciated!

Markus
--~--~-~--~~~---~--~~
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: Broken after update: FileNotFoundException on openFileOutput

2009-02-20 Thread Markus Junginger

It seems that the copy protection feature in the Market is broken, so
I recommend NOT to switch it on if you rely on file access.

I filed a bug report against Android:
http://code.google.com/p/android/issues/detail?id=2047

Again a tiny little checkbox causing so much trouble... Hope not too
many users left my app QuickSearch behind because of 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: Amazon Web Services (AWS) from Android

2009-02-23 Thread Markus Junginger

Btw, if you are talking about "Amazon Associates Web Service":
http://aws.amazon.com/agreement/#5.1
"5.1.5. Unless we have provided you our express written consent in
advance, you are not permitted to use Amazon Associates Web Service in
connection with any handheld, mobile or mobile phone application."

--~--~-~--~~~---~--~~
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: TERRIBLE BUG IN MARKET APPLICATION (was Re: Paid apps related questions discussion list?)

2009-02-23 Thread Markus Junginger

I had similar issues, but I do not have paid apps. By try&error I
figured out it was the "copy protection" feature. So far, nobody
replied to my posts or my bug report I created, however.

--~--~-~--~~~---~--~~
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: Amazon Web Services (AWS) from Android

2009-02-25 Thread Markus Junginger


> Don't give up on the AWS project just yet ;).

What are the options?

It is better to quit a project asap if you are not allowed to do it. I
know of other mobile apps, which were not permitted by Amazon, and
believe me, it's more frustrating to quit a project that got
completed.

But anyway, has someone insights into this Amazon policy? I do not
quite understand it. There are types of mobile apps that would
generate Amazon sales, and others that won't. But Amazon does not seem
to differentiate. They seem to have their own agenda regarding mobile.
*shrug*

If someone an idea how to get permitted by Amazon, I would be more
than happy to know.

Thanks,
Markus
--~--~-~--~~~---~--~~
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: Amazon Web Services (AWS) from Android

2009-02-25 Thread Markus Junginger



On Feb 25, 1:27 pm, Sena Gbeckor-Kove  wrote:
> Use a proxy server or adapter?

I think that does not make a difference to Amazon - they seem to
disallow using the data on mobile devices, no matter where the data
came from.
--~--~-~--~~~---~--~~
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: Broken after update: FileNotFoundException on openFileOutput

2009-02-27 Thread Markus Junginger


> I think that I've been bitten by the copy protection bug as well.  It
> seems to be intermittent though. Is your app working ok now?
I cannot tell for sure. However, user rating is rising again, which is
a good sign. And my own tests (I uploaded 7 versions just to test it
to the market) looked good. It may be that users have to uninstall a
protected version manually though.

> Did you simply disable the copy protection checkbox or did you have to
> reupload a new version?
I simply unchecked the 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] What happens between two View.onDraw calls? (Game, FPS)

2009-02-27 Thread Markus Junginger

I am in the middle of writing an game and got curious what happens
outside my code. I extended the View class with everything happing
inside onDraw (updating the model and rendering it). Before onDraw is
exited, a invalidate() is fired so the View gets repainted
continously. With this approach I get 60 fps most of the time
(sometimes it lacks behind shortly), which is OK for now. However, the
game will get more complex, and I did some measuring with the
following averages of painting one frame:

* My code inside onDraw consumes 5ms
* Between the calls of onDraw 10ms are "consumed"

So twice the time is spend outside my code: What exactly happens here?
Is there just a 60fps maximum (causing the system to wait until the
next frame is painted), or is there so much overhead going on behind
the scene?

I know about SurfaceView and decoupling the rendering from the GUI
Thread, but I haven't tried that yet. To me, it did not seem to make a
difference in which thread my game code is executed, so I stayed with
the View so far.

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



[android-developers] Re: What happens between two View.onDraw calls? (Game, FPS)

2009-02-27 Thread Markus Junginger

Hi Romain, thanks for your reply.

On Feb 27, 10:42 pm, Romain Guy  wrote:
> You cannot achieve more than 60 fps because of the way the UI is
> sync'd with the underlying hardware.
So basically the framework waits for the next update cycle, I assume?

I still wonder about what's going on behind the scene. When I operate
on the Canvas, a pixel buffer is probably filled directly (Bitmap)? Is
this buffer/bitmap then copied once (for every frame) into a hardware
buffer, which is the source for the hardware display?

> The invalidate/onDraw mechanism
> can be very costly for a game if you have a deep view  hierarchy.
There is just one View, so that would be OK in terms of costs? Or are
there any less costly ways?

So the advantage of using a SurfaceView would be that one could use
these "in between" times to prepare the next frame, I suppose? So,
this might result in a smoother result (when the timing is right)...

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



[android-developers] Re: What happens between two View.onDraw calls? (Game, FPS)

2009-02-27 Thread Markus Junginger

Thanks for the clarification.

I will switch to SurfaceView some time. Maybe I will do some
comparisons in terms of performance of the two approaches. Anyone done
this before?

Another thought was if it would matter in terms of performance if one
could directly write to hardware buffers to prevent copying. But I
guess copying 300KB (320x480x2 Bytes) of memory for every frame does
not take long anyway.

Markus
--~--~-~--~~~---~--~~
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: TERRIBLE BUG IN MARKET APPLICATION (was Re: Paid apps related questions discussion list?)

2009-03-02 Thread Markus Junginger

I wonder if it might be the same issue I ran into:
http://groups.google.com/group/android-developers/browse_thread/thread/c529496c831eded2/e0e8a406084f0a24
http://code.google.com/p/android/issues/detail?id=2047

I have only free apps, but paid apps are always copy protected, right?
So, if apps break that rely on file / DB access, and the others don't
it could make sense.
--~--~-~--~~~---~--~~
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] ADT 10.0.0 Issues

2011-03-01 Thread Markus Junginger
Since I updated ADT, I am experiencing CPU load issues. One of the
cores goes to 100% when I use the layout editor for a while. I am
running Windows 7, and a friend confirmed this issue with Linux. Is
there a known workaround?

Also, at least when running Windows, the new palette looks shaggy due
to bitmap scaling issues.

And speaking of ADT: are there any known plans to improve performance?
We have several larger project and every time we update a single file,
ADT seems to build the entire APK from scratch. This takes up to
almost a minute, which decreases productivity. The builder could be
more intelligent and just update the deltas.

Lastly, I am just writing an article on ADT, so I could mention some
future plans, if anyone from Google happens to read this.

Thanks,
Markus

--
http://greenrobot.de

-- 
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] ADT 10.0.0 Issues

2011-03-02 Thread Markus Junginger
Thanks for the information, it's nice to see the ongoing effort and the 
increased development speed in the last months. :)


I attached the thread dump, Tor requested. Hope it helps.

Markus

--
Markus Junginger

http://greenrobot.de, http://twitter.com/greenrobot_de

Dollinger&  Junginger Unternehmergesellschaft (haftungsbeschränkt)
Agnes-Pockels-Bogen 1, 80992 München
Handelsregister München HRB 179018
Geschäftsführer: Markus Junginger, Vivien Dollinger

This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEDGED and CONFIDENTIAL. If you are not the intended 
recipient, dissemination of this communication is prohibited. If you have 
received this communication in error, please erase all copies of the message 
and its attachments and notify us immediately.

--
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=enFull thread dump Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode):

"AsyncQueryWorker" prio=6 tid=0x488f7800 nid=0x2bac runnable 
[0x5090f000]
   java.lang.Thread.State: RUNNABLE
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:119)
at android.os.Looper.loop(Looper.java:116)
at android.os.HandlerThread.run(HandlerThread.java:60)

"AWT-Windows" daemon prio=6 tid=0x48931800 nid=0x3784 runnable 
[0x4d05f000]
   java.lang.Thread.State: RUNNABLE
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(WToolkit.java:293)
at java.lang.Thread.run(Thread.java:619)

"Java2D Disposer" daemon prio=10 tid=0x48927800 nid=0x1a78 in 
Object.wait() [0x4c42f000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x21d78390> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <0x21d78390> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
at sun.java2d.Disposer.run(Disposer.java:127)
at java.lang.Thread.run(Thread.java:619)

"Thread-3" daemon prio=6 tid=0x4a3a3000 nid=0x9c4 in Object.wait() 
[0x5345f000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x1ac27eb8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <0x1ac27eb8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
at 
org.tmatesoft.svn.core.javahl.SVNClientImplTracker.run(SVNClientImplTracker.java:65)
at java.lang.Thread.run(Thread.java:619)

"Device List Monitor" prio=6 tid=0x4a3a4000 nid=0x3aec runnable 
[0x52e1f000]
   java.lang.Thread.State: RUNNABLE
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:237)
at sun.nio.ch.IOUtil.read(IOUtil.java:210)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
- locked <0x18b16e18> (a java.lang.Object)
at com.android.ddmlib.DeviceMonitor.read(DeviceMonitor.java:949)
at com.android.ddmlib.DeviceMonitor.readLength(DeviceMonitor.java:922)
at 
com.android.ddmlib.DeviceMonitor.deviceMonitorLoop(DeviceMonitor.java:187)
at com.android.ddmlib.DeviceMonitor.access$000(DeviceMonitor.java:42)
at com.android.ddmlib.DeviceMonitor$1.run(DeviceMonitor.java:82)

"Worker-62" prio=6 tid=0x4a3a1000 nid=0x1c9c in Object.wait() 
[0x52b1f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x16c784e8> (a 
org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:185)
- locked <0x16c784e8> (a 
org.eclipse.core.internal.jobs.WorkerPool)
at 
org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:217)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:51)

"Worker-44" prio=6 tid=0x488f8000 nid=0x17f4 in Object.wait() 
[0x5191f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

[android-developers] Are dialogs supposed to be modal?

2011-04-14 Thread Markus Junginger
After years of using dialogs, today I got doubts that they are
strictly modal after all. There seems to be a short time span in which
it is possible to hit other Views AFTER show() of the dialog is
called.

Does this work as intended?

Any ideas how to make a dialog really modal?

Have a look here for some details:
http://stackoverflow.com/questions/5666707/bypass-modal-android-dialogs-by-clicking-buttons-twice-fast-enough

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