Android :: Excessive JNI Global References Seen On 1.5 But Not 2.1
Aug 11, 2010
There's a bug in my network code so that when the server's not available the Android client tries over and over to connect. On 1.5 (emulator) this results, within a minute, in an "Excessive JNI global references" error where the leaked object is a small (20 byte) boolean array. The same code on emulated 2.1 runs for as long as my patience lasts. Is there any possibility the leak is in my code and not an Android bug that's been fixed since 1.5?
View 2 Replies
May 11, 2010
I'm currently working on Android NDK, porting my libs, and I'm using SWIG (Simplified Wrapper and Interface Generator) that is a great tool to generate JNI code around my C/C++ headers for Java.
However, there is a big issue using it on Android, 'cause of incomplete JNI support : 'Weak Global References' are missing. Unfortunatly, SWIG is waiting for a full compatible Oracle/Sun JVM, and use this feature with its 'director' option (for proxy class creation).
For now, I comment each time, in a (kind of) bad way, the use of weak global references in my generated C/C++ wrapper files (4 lines in my case). I think it is really a shame that we can't use (one of) the best wrapper with Android NDK just for one missing feature.
I read that Google Team will add it in future release : "NewWeakGlobalRef and DeleteWeakGlobalRef are not implemented. The VM supports weak references, but not JNI "weak global" references. These will be supported in a future release." (http://android.git.kernel.org/?p=platform/ dalvik.git;a=blob_plain;f=docs/jni-tips.html;hb=HEAD)
So my question is, does anybody know when 'Weak Global References' will appear in Android NDK ?
View 4 Replies
View Related
Feb 26, 2010
I'm writing an Android game that needs to receive touch events. My problem is that, whenever the user drags their finger along the screen, so many touch events get sent to the touch event handler (which I think runs as a separate thread) that my frame rate plummets! What's the best way I can limit the number of touch events that are handled per second? For example, if my game runs at 60 fps, I really shouldn't need more than 1 touch event being handled every second. Can I do this is a way that doesn't lose any information (i.e. important information about where on the screen the user touched last)?
View 2 Replies
View Related
Apr 20, 2010
I have a static Preferences class that hold some application preferences and stuff like that. Is it ok to store reference to ApplicationContext there? I need that reference so i can get cache folder and stuff like that in classes that don't inherit Activity.
View 1 Replies
View Related
Nov 5, 2010
I wonder if it's possible to reference a XML string value in another XML String resource.But in case of an concated resource string, I found no solution yet,I would like to keep the string references in the string.xml file itself.
View 1 Replies
View Related
Jun 25, 2010
I'm writing some stuff in java and i ran into some problems lately. cut short, i need to compare an object i created to another instance of this very class i instantiazed before with different data.
looks like this:
CODE:........
with a class a:
CODE:..........
The problem is, that i end up finding out that the values from newA are always equal to those from oldA. so i guess sth went wrong with passing the references of the objects in the last line of the loop...i thought java always passes references of objects unless an explicit copy() is called? if this does matter: this code is running on android - don't know if the dalvik vm messes aroung with this...
View 5 Replies
View Related
Jul 21, 2010
I would like to add an HTML resource to my Android project with references to other resources (mainly drawables).
Where should I put it and how do I reference other resources from it?
Is there a particular way to pass the HTML resource to a WebView?
View 2 Replies
View Related
Jul 27, 2010
I've read that it is a mistake and a source of memory leaks in Android application to keep a long-lived references to a Context.
But I don't understand if it is ok to create an class that looks like this one:
CODE:..........
And call it from an Activity:
CODE:.................
View 2 Replies
View Related
Jan 3, 2010
I'm running into some issues with input events and garbage collection, or more precisely object allocation. I am creating a game and have pretty much got my head around the OpenGL environment. I've digested all the relevant material I could find regarding performance, memory allocation etc (and watched the excellent presentation by Chris Pruett - http://code.google.com/events/io/2009/sessions/WritingRealTimeGamesAn...). I've pretty much eliminated any object allocations after initial setup from my game (which is still in its infancy), but I'm still getting a bunch of GC calls, like this:...........................
View 6 Replies
View Related
Nov 24, 2010
I am working on a system on which currently Linux kernel and microwindows windowing system is running. Code of current Linux system drivers is available to me. I want to port android on it, just as a hobby project.
can you please tell me what all understanding of linux-kernel is required to port it?
Please give me references (Books, Tutorials) to build-up understandings.
View 3 Replies
View Related
Oct 27, 2010
I'm in the middle of implementing themes for my application right now, and everything's been going really smooth until as of late. I've been using the android:background="?thin_border" tag to provide a background for linearlayouts with items that I want visually grouped together. The problem I'm running into is when I try to use this tag in an xml with a custom class as one of the elements, and try to add this background tag.
I've got an xml file that looks generally like so:
CODE:.................
and the custom class has two constructors:
CODE:........
with some other functions that store values, manipulate the data, etc. The custom layout class is only ever called directly in the xml, and the xml is inflated like so:
CODE:...........
The problem I'm running into is that I'm getting these error messages:
CODE:.................
The error seems to be caused by the android:background="?thin_border" tag. If I remove it from the layout, it inflates fine, and the program continues on. As soon as I add it back in, I get these errors and the program stops.
View 2 Replies
View Related
Mar 14, 2010
I need to create paused analog clock. Since I have never done any graphics/drawing before I am customizing Analogue widget defined in the core/java/android/widget.
The problem is when I create the class in my project following are the unresolved references: mContext com.android.internal.R mRight mLeft mTop mBottom
I know the most likely cause is com.android.internal is private and I need to use public but the problem I do not know what the public equivalent is. I have tried substituing it with android.R but that doesn't seem work either.
View 2 Replies
View Related
Dec 8, 2009
I'm working on an application that requires non-serializable objects to be passed between Activities. The following page suggests using a HashMap of WeakReferences to accomplish this:
http://developer.android.com/guide/appendix/faq/framework.html
Is this solution safe? I know Activities are completely destroyed and recreated when the screen orientation changes. Couldn't those weakly referenced objects get GCed in the split second when the screen is rotated, since they wouldn't be referenced elsewhere at that point?
View 3 Replies
View Related
Apr 26, 2010
While researching how to create custom compound views in Android, I have come across this pattern a lot (example comes from the Jteam blog)I mostly understand how this is working, except for the part where inflate() is called. The documentation says that this method returns a View object, but in this example the author does not store the result anywhere. After inflation, how is the new View created fromt eh XML associated with this class? I thought about assigning it to "this", but that seems very wrong.
View 1 Replies
View Related
Oct 28, 2010
Is it just me or is rovio advertising a little too much in their Angry Birds game? I've cleared all levels and working on getting three stars in a few levels that I have just two stars in. I get a VIDEO ad after every 2 or 3 games. That is really annoying.The advertising was not so excessive until I had not cleared all levels. It just got too much after that.
View 32 Replies
View Related
Apr 9, 2010
one of my other issues with my newly acquired X10 is its apparent heavy CPU usage. I would go so far as saying that the phone is close to unusable when it has just booted. So here goes my findings. I've installed a program called CPU Usage (quite logically) which monitors CPU usage for various tasks on the phone. Here is what I get when the phone has just been booted:
PID / Name / CPU Usage
954 / Sync Feeds/Checking Service/Setting Storage/Android System / 39-58% (No, I'm not kidding)
1054 / Download Manager/DRM /23-31% (still not kidding)
1171 / Face Recognition Service / 11-12% (not as bad, but still, why is it even there???)
The worst thing is that these services don't stop using the CPU - no, they keep on running and using CPU in the designated ranges, unless I kill them. So I go and kill them using another program I installed...................
View 6 Replies
View Related
Aug 10, 2010
I just got the shock of my life when I looked at my data counter and found that I'd used 3x my monthly allowance, and about 6x more data than I normally use. I've not installed any new apps recently, all that is different is that I upgraded to Froyo about a week ago. I even removed Facebook, due to the battery issue, so I have no idea what is suddenly consuming so much data. Can anyone recommend an app that will show you what is actively using your data connection, or can tell me what has been using the connection recently? I really need to find out what the app is, and kill it, as I've had to disable my data connection to prevent any further costs. FWIW, been looking at the phone this morning, and the data connection is constantly live, so whatever it is, it's using data all the time.
View 3 Replies
View Related
Mar 30, 2014
A friend has ordered her first ever smartphone (Moto G) and I am tasked with showing her the ropes on using it. Although she really isn't technically-inclined, she does listen to what she is told and I really want to instill good, safe habits in her from the outset.
One of the lessons she needs teaching is regarding malicious apps, and checking permissions before installing anything. You know, stuff like games which want access to make phone calls, send sms, etc
To be clear, what I'm looking for is apps that request excessive permissions, so I can show her what she should be looking out for and avoiding when she's installing apps
View 1 Replies
View Related
Nov 3, 2009
Anyone else getting an excessive amount of force closes? I must have had like at least 5 today.
View 14 Replies
View Related
Sep 23, 2010
Why has my Galaxy started popping up the word choice box every time I enter a single character. It has only just started doing this, so I have obviously managed to change something, but no idea what??
View 3 Replies
View Related
Jun 5, 2010
Ever since I installed the Android 2.1 update I have noticed a significant increase in my battery depletion when I am using the camera app. This is even if I am using the camera app for a very short period of time. For example, I might take three or four shots in the course of two minutes and my battery drain would be on the order of 7% - 8%. This is way more battery drain from the camera app than I ever witnessed when I was using it with Android 1.5.
I also noticed on the battery status screen, where you can see how much percentage of your total battery life that various apps and system processes are using, that the camera app skyrockets up to over 90% of the total usage every time I use it for a few minutes.
View 17 Replies
View Related
Apr 17, 2010
I'm searching for some good material on android threads but I couldn't find references for a complete description about this subject. So if you know any valuable reference please point them to me.
View 1 Replies
View Related
Nov 17, 2009
Is it me or the 2.0 icon spacing on home screens are a bit far apart. there has to be a way to tweak that.
View 5 Replies
View Related
Sep 2, 2010
I've been trying to diagnose a memory leak in an Android application I'm writing. I got a heap dump loaded into Eclipse, but the results I'm seeing are very curious. There are some 20,000 instances of an exception (specifically, LDAPException from the UnboundID LDAP library) in the heap with no inbound references.
That is, they show up at the root of the dominator tree. The OQL SELECT objects e FROM com.unboundid.ldap.sdk.LDAPException e WHERE (inbounds(e).length = 0) returns over 20,000 results, totalling to nearly all of the heap. And yet, the GC runs before the heap dump and I can see that it's running in the console, repeatedly, during the execution of the leaky code. If these instances have no inbound refs, what could be keeping them alive?
I also tried doing a "shortest paths to GC" query. It shows one LDAPConnectionReader row retaining 2 instances, and ~20k LDAPException @ <addr> unknown rows with various hex addresses.
Update: I haven't had time to further diagnose this since posting it, and the bounty I posted is ending before I likely will. I'm awarding it as best I can now, lest the points go to waste. Thanks to everyone who looked into this! I will come back later and update again with the results of further diagnosis, when life is a little less hectic.
View 3 Replies
View Related
Feb 26, 2010
I'm very new (second day!) to android and working my way through the dev guide. There, it says that you can reference attributes inside the current theme from your XML by using the form?.If I try to build this, I just get "No resource found that matches the given name (at 'textColor' with value '?android:textDisabledColor')
Given that this seems pretty basic stuff, and yet I can't find any references to similar problems elsewhere, I must be missing something obvious or misunderstanding something simple. Can anyone tell me what it is?
View 1 Replies
View Related
Mar 28, 2009
Can anyone hep me with how to make a (boolean) variable global in Android?
View 2 Replies
View Related
Jan 14, 2010
Is there something like an application global onPause() and onResume()?
My main activity listens for GPS fixes, which I want to continue working when switching to another screen/activity. Therefor I cannot unregister my LocationListener in the activity's onPause(). However I still want to unregister my GPS listener when switching to another application (so save battery) and turning it back on when returning to my application, regardless what screen/activity the user is currently in. Any ideas?
View 1 Replies
View Related
Jan 31, 2012
How is declare global variable in android...some link send me...am searched various post..but am not clear about dis concept...send me valuable link..
View 3 Replies
View Related
Sep 27, 2010
Is the a way to export my Dolphin bookmarks out to the Global Bookmarks so they will appear in the stock browser?
View 1 Replies
View Related
Mar 17, 2009
In order to communicate with the server I need a huge global object (class with some hashmaps). all my activities (about 10) need that huge global object. which options do I have? I am thinking about passing the object using intends and about the possibility to make the object a singleton. using the db will be much too slow.
View 3 Replies
View Related