Android :: HTML Resource With References To Other Resources
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
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
Apr 19, 2010
My android application has several warnings of the following form when I run it in the emulator:
"Resources don't contain package for resource number <Hex Address>"
How can I fix these warnings? In particular, is there an easy way to find out what the hex address refers to?
View 2 Replies
View Related
Nov 15, 2010
I'm writing on a custom view in android. It uses some png's, provided as resources in the drawable-folder (I put it in all of the drawable folders now, just to make sure) of my project. Unfortunately, when I startup the app, I get a force close and the last thing the log says is: "WARN/ResourceType(261): Resources don't contain package for resource number 0x7f020002" (The Hex-Number is the first icon I intend to load). Now for the curious thing: The graphical layout-editor of the eclipse adt plugin has no problems whatsoever loading an displaying the icons in its design view. It's only when I start up the actual app (emulator or actual cellphone), that android can't find the resources. I tried cleaning the project and refreshing the file structure.
View 2 Replies
View Related
Sep 18, 2009
How to reference resources (images) from a HTML page in webview? I am trying to display an image in HTML and the image is an android resource. <html> <body> <img src=" ? " /> </body> </html>
View 2 Replies
View Related
Oct 17, 2010
I have a webview in my activity and loaded contents for webview by following:
CODE:..................
In description.html i have a reference for another html file located in the same place by following:
CODE:..................
This was working absolutely fine in emulator but when i run it on my Galaxy S mobile, hyperlink does not work fine. Kindly help me. Is there any permission i am missing or something else?
View 1 Replies
View Related
Nov 15, 2010
How do you display different images for different screen resolutions (hdpi, ldpi, mdpi) in an embedded HTML resource of an Android app?
View 1 Replies
View Related
Apr 19, 2010
I know I can put escaped HTML tags in string resources. However, looking at the source code for the Contacts application I can see that they have a way of not having to encode the HTML.Unfortunately, when I try something similar (like Hello, <b>World</b>!), getString() returns the string without the tags (I can see that in logcat). Why is that? How can I get the original string, with tags and everything? How is the Contacts application doing it?
View 1 Replies
View Related
Jun 28, 2010
Is there any way to have an html file (i.e. an html template) be a resource in android? I'd like to reference it in a similar way that i store strings in the res/values/strings.xml. However, when i do this, it appears the HTML is not getting rendered correctly when i use code...
View 1 Replies
View Related
Nov 1, 2010
I have heavily edited the original text and instead of the how question I am posting the code that produces the effect I wanted, namely a floating menu on top that stays fixed as I scroll whatever is in the middle with a lower menu at the bottom of the screen. Ain't life sweet - Might even work on the iPhone as well.
Why I posted was like I said in the original question. I'm fiddling with creating the initial lay out for a "mobile" application for the disabled, have tonnes of data, dictionary files, icons for the purpose etc. I want to have the app running as HTML to make it as portable as possible, i.e. make it runnable on Android, Iphone, Maemo... whatever.
I got some hints by looking at the example at http://www.quackit.com/css/codes/css_floating_menu.cfm as well as a lot of trial and error and finally minor edits by a paid freelancer.
Below you can find some crude (to put it mildly) HTML/CSS (cut the CSS part and load a style instead in the HTML's you create for cleaner code) but for now, let's look at the prototype concept.
CODE:...........
You can see the working example on your Android device or in your Android emulator http://globability.org/webapp/aaa.html
Need to get the sound working though - but nearly there :)Links to the different web based version and thoughts behind application can be found on:
The project this application springs from can be found on [url] - Look under prototypes (it is the top one under the heading protypes).
View 1 Replies
View Related
May 13, 2010
I;ve been trying to create a custom button in android using this tutorial - http://www.gersic.com/blog.php?id=56
It works well but it doesn't say how to change the font size or weighting. Any ideas?
There was another question on here and the only answer was to use html styling but you can't change a font size in html without using css (or the deprecated font tag). There must be a better way of setting the pixel size of the font used on buttons?
View 1 Replies
View Related
Jul 11, 2010
In my Android project, I want to loop through the entire collection of Drawable resources. Normally, you can only retrieve a specific resource via its ID using something like:
InputStream is = Resources.getSystem().openRawResource(resourceId)
However, I want to get all Drawable resources where I won't know their ID's beforehand. Is there a collection I can loop through or perhaps a way to get the list of resource ID's given the resources in my project?
Or, is there a way for me in Java to extract all property values from the R.drawable static class?
View 4 Replies
View Related
Aug 3, 2010
I have an XML resource file:
<resources> <section>
<category value="1" resourceId="@xml/categoryData1" />
<category value="2" resourceId="@xml/categoryData2" />
<category value="3" resourceId="@xml/categoryData3" />
</section> </resources>
Using XmlPullParser, on the START_TAG, I can use:
int value = parser.getAttributeIntValue(null, "value", 0);
to get values 1, 2, 3...however:
int resourceId = parser.getAttributeIntValue(null, "resourceId", 0);
doesn't work...it just yields the default value 0, or whatever I change the default value (3rd parameter) to be. Does anyone know what I am doing wrong or if this is possible?
View 1 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
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
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 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
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
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
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
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
May 3, 2010
Is it possible to reference other strings inside of strings.xml ?
Something of the form...
(If it did exist, there would of course be problems of circular, infinite definitions, etc. to beware of).
View 1 Replies
View Related
Mar 31, 2009
I currently have a few classes that are called by an activity (some statically) in which I want to use a string resource. I tried: Resources.getSystem().getString(R.string.mystring), but am getting an error. It seems as though you can only use this within an activity.
Is there anyway to use a project resource in a standard (non Activity) class without having to pass the resource object from the activity calling the class?
View 3 Replies
View Related
Oct 18, 2010
I have an app with 2 Activities and an IntentService all which need to access the same SQLite Database table. What's an appropriate pattern to use?
Should I create a ContentProvider that manages access to the database, ie opening/closing, querying, updating etc. And have the 3 clients all access the DB via the ContentProvider?
Or is it OK for each client to access the DB directly? This is the approach I have now and it seems to be working, but I need to close my cursor and the DB after executing every statement or I start generating stacktraces in the log about unclosed DB resources. But closing the DB after each statement seems wasteful and I suspect that this approach will always be susceptible to the stacktraces because there is always the potential for collisions between either of the Activities and the IntentService.
I haven't been able to find any good resources that show DB usage in full. It always snippets that miss out the *obvious* piece such as when should the resources be closed etc.
View 6 Replies
View Related
Feb 13, 2009
Anyone was able to play a video included in the .apk? I'm able to play this video from the SD card but not when it's a resource.
View 6 Replies
View Related