Android :: Reading Precomputed Vertex Arrays In Application?
Sep 6, 2010
My app has large vertex arrays that are pre-computed before I even build the app for distribution. I'd like to store these in assets (recognizing the size limits of asset files) and read them in with minimal computation. Can I store them in binary, and just read them into an NIO buffer, and then wrap it for GL, or do I have to go through the whole compute intensive (?) process of reading it in, making a byte array, and converting that to an integer (in this case) array?
View 5 Replies
May 18, 2010
Working through some OpenGL-ES tutorials, using the Android emulator. I've gotten up to texture mapping and am having some trouble mapping to a cube. Is it possible to map a texture to all faces of a cube that has 8 vertices and 12 triangles for the 6 faces as described below?
// Use half as we are going for a 0,0,0 centre.
width /= 2;
height /= 2;
depth /= 2;
float vertices[] = { -width, -height, depth, // 0
width, -height, depth, // 1
width, height, depth, // 2......................
View 1 Replies
View Related
Oct 5, 2010
I like to know some application to read out Ebooks and docs I have in SD card. I am very new to android.
View 1 Replies
View Related
Mar 16, 2010
I have experienced some trouble using VBOs, since the method glBufferData crashes when I try to copy data to the vertex buffer. Below is the smallest snippet of code that I found to generate the crash:
int numVert = 32; GL11 gl11 = (GL11)gl; testArray = new int[numVert * 3]; testBuffer = IntBuffer.wrap(testArray); gl11.glGenBuffers(1, testID, 0); gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, testID[0]); final int siz = testBuffer.capacity() * Integer.SIZE; gl11.glBufferData(GL11.GL_ARRAY_BUFFER, siz, testBuffer, GL11.GL_STATIC_DRAW); gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
testArray, testBuffer and testID are members of the class containing this code, declared as follows:
int[] testArray; IntBuffer testBuffer; int[] testID = {0};
I tried this code in several OpenGL applications which don't show any problem otherwise. The crash occurs specifically at the glBufferData() method call. If numVert is set to zero, then the crash doesn't occur.
View 4 Replies
View Related
Nov 6, 2009
Is there any type of apps to read books (particularly Google books) on the Droid?
View 1 Replies
View Related
Jun 10, 2010
Hey Can anyone tel me how to use arrays in Android.I need to add the numbers given by the user
View 1 Replies
View Related
Sep 29, 2010
I am trying to create a information based application, I have 92 subjects, for these subjects I have 92 map locations and maybe as much as 400 url links. Currently I have created a class for each map location and a class for each url link, but this would mean I would have in excess of 500 classes, so what I want to do is split the subjects in four catergories ie. listview of about 23 in four tabs which I have done and create a class that gets the url based on the selection the use makes and do the same for the map locations.Do I need to put these in a xml using the id method and how do you call individual entries, i.e. would I need 500 Android:id is there an easier way?
View 2 Replies
View Related
Mar 16, 2010
I am just trying to display a list from an array that I have in my arrays.xml. When I try to run it in the emulator, I get a force close message. If I define the array in the java file (String[] testArray = "one","two","three","etc";) it works, but when I use "String[] testArray = getResources().getStringArray (R.array.testArray); " it doesnt work.Here is my Java file:package com.xtensivearts.episode.seven;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;public class Episode7 extends ListActivity { String[] testArray = getResources().getStringArray(R.array.testArray); /** Called when the activity is first created. */
View 1 Replies
View Related
Jul 22, 2009
Arrays.copyOfRange() is unavailable in Android, so I'm wondering what the preferred method of copying arrays is. Manually over a loop, or System.arraycopy()? Also, what was the reason behind the decision to not include Arrays.* ?
View 2 Replies
View Related
Jan 1, 2010
I would like to create a list objects called Product (Listproducts).In the application I first have to create the list List products from XML file and then display the products on the map. One product can be located at several locations.Does anyone know what is the most appropriate way to create the structure (a list or linked list) which is the easiest to iterate through and enables to link the lists? The logic should work the following way:
1. Read each point from the list
2. Check which product belongs to the point
3. Display the product informations on the map
View 5 Replies
View Related
Oct 10, 2010
I recently created a program that gets medi-large amounts of xml data and converts it into arrays of Strings, then displays the data.The program works great, but it freezes when it is making the arrays (for around 16 seconds depending on the size).Is there any way I can optimize my program (Alternatives to string arrays etc.)
View 3 Replies
View Related
May 5, 2010
How to create arrays of class instances in JAVA. code...
View 1 Replies
View Related
Dec 13, 2009
Does anybody know of a work around for the android xml file string array inability to process string <item>'s that are not legal java variable names If not, is this not a major bug? Why does an item in an array need to generate a reference id anyway? Isn't this redundant?
View 2 Replies
View Related
Jul 26, 2010
I am using a simple expandable list that is populated by two arrays ( group array for the groups and a multi dimensional children array for the child). The arrays are built dynamically in the program and some group items have more children than others. So I end up defining the highest number as the array size for the multidimensional child array. After populating the child array, some positions are left null, as there are no values for those group items (explained above). When I associate this with the expandable list adapter, the getChildView method throws a nullpointer exception when it comes across a position in child array that does noto have value. I have two questions:
1. Can I make the base adapter skip the shildview method if the value in that child is null? The current implementation of getchildView method has to return a view and even if I suppress the nullpointer exception, it adds a blank element in the child position in the list.
2. Is there a better way of associated multidimensional arrays that are populated at run time? The current set of examples only use hardcoded string array values. Even the cursor adapters examples use very basic setup.
View 2 Replies
View Related
Feb 7, 2013
In terms of efficiency, is it better to use arrays programmatically or through calls to xml files.
I'd prefer to use xmls for organisational reasons, but is there much of a performance hit.
View 3 Replies
View Related
Apr 4, 2010
I simply need to add floatArray1 to floatArray2 storing the result in floatArray2.. no third array. all arrays are one dimensional but are very large. probibly as large as the os will let me get away with. Max i would need is two float arrays with 40,000 floats each. but i could get away with 1/10th that i suppose minimum.Would love to do this in 1/30th or 1/60th of a second but that does not seem possible? Also if the code is JNI,NDK or OpenGL ES thats fine. does android have an assembly language or like machine code i could use somehow?
View 1 Replies
View Related
Jul 28, 2009
Im currently developing a system where the user will end up having large arrays( using android). However the JVM memory is at risk of running out, so in order to prevent this I was thinking of creating a temporary database and store the data in there. However, one of the concerns that comes to me is the SDcard limited by read and write. Also another problem that comes to mind is the overhead of such an operation. Can anyone clear up my concerns, as well as also suggest a possibly good alternative to handling large arrays ( in the end these arrays will be uploaded to a website by writing a csv file and uploading it).
View 1 Replies
View Related
May 24, 2010
I am a newb to Android and Java and want to write a funtion that will display a list based on a varable that I pass to the function. The function is below and the code below creates an array out of a string called type, but what I want to do is pass it a variable string and have it build a list based on that string. So if I wanted the type list I would say list_it("type")But if I try something like getResources().getStringArray (R.array.thelist); it doesn't work.Can someone point me in the right direction? public void list_it(String thelist){String[] types = getResources().getStringArray(R.array.type); ArrayAdapter<String> mAdapter = new ArrayAdapter<String>(this, R.layout.list_item1, types);
setListAdapter(mAdapter);
ListView lv = getListView();
lv.setTextFilterEnabled(true);
View 1 Replies
View Related
Dec 11, 2009
I'm trying to write an array of objects that implement Parcelable into a Parcel using writeParcelableArray.The objects I'm trying to write are defined (as you'd expect) as:public class Arrival implements Parcelable {All the right stuff in here this class compiles and acts fine And I'm trying to write them into a `Parcel' with: @Override public void writeToParcel(Parcel dest, int flags) I completely don't understand this error message. Parcelable is an interface (not a class) so you can't extend it. Anyone have any ideas? UPDATE: I'm having basically the same problem when putting an ArrayList of Parcelables into an Intent:Intent i = new Intent();i.putParcelableArrayListExtra("locations", (ArrayList< Location> ) locations);Yields: The method putParcelableArrayListExtra(String, ArrayList< ? extends Parcelable >) in the type Intent is not applicable for the arguments (String, ArrayList< Location >)This may be because Location was the class I was working on above (that wraps the Arrivals), but I don't think so.
View 2 Replies
View Related
Oct 23, 2009
I am facing a problem in my Android app which is calling native functions through JNI. So thought somebody in this group can help me to resolve this. The current code :
1. Create an array in JNI layer ( by NewIntArray()) which can be used by both Java & C.
2.we can name that array as type jintArray array.
3.We call GetIntArrayElements() on this array to get its elements i.e, int * elementsX.
4. This elements would be used by a native call which will set it to some value.(project specific* : may not need interest for this issue)
5. We now get the updated value of elements. And copy it back to array using ReleaseIntArrayElements()
6.We use array in bitmap/canvas class of Java layer to display on screen. The whole procedure is followed for (480x640) times. And so there is a redundant creation of the array for every frame display. Is there any way to avoid this creation of array for each frame. Any better solution to achieve the above? I am not getting a way out of this & the performance of my app has gotten very low too Any JNI code snippets to modify steps (1 to 3 & 5) would be of great help to me.
View 3 Replies
View Related
Oct 16, 2010
I have a ListView that displays every item in an array called, "Facts_Array". What I would like to do is display the count of the item clicked on.When an item is clicked in the listview, it displays it using Toast. What I would like to change is what the toast displays. I would like it to find the number in which the item comes. If I click on the second item in the list, I want it to display number 2.
View 1 Replies
View Related
Oct 28, 2009
I want to get an array of strings reading from arrays.xml file we add in android values/ folder. Could any one kindly give a solution for this. Otherwise I will have to input each these entries in strings.xml and take them to java code using getResources()getString()
View 2 Replies
View Related
May 6, 2009
I am trying to see if user applications can READ the framebuffer e.g. / dev/graphics/fb0. I find that there is a permissions flag "android.permission.READ_FRAME_BUFFER", but there is no API, which can be used to grab the frame buffer.Is there a plan to provide an API for reading the frame buffer in future android releases?
View 3 Replies
View Related
Jun 22, 2009
I am reading the following URL to test a RSS parser. http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk/rss.xm
When using the same code on a Android HTC phone the whole resource cannot be read. There are no exceptions being thrown. I am guessing the rss.xml is too large to be read in? I use a sax parser after the block of code which complains. Code...
View 4 Replies
View Related
Jun 18, 2010
Say I'm on cnn.com and I'm driving and want to hear the text.
Is there an application that will do this?
View 1 Replies
View Related
Nov 16, 2008
1. Compose a new message in GMail. (If you are still without a GMail account, request a GMail Invitation code)
2. Attach any PDF or Word document that you want to convert to HTML You can attach multiple files in this step by clicking Attach another File.
3. Enter your own email address in the To: box and click send.
4. You instantly receive a message in your GMail Inbox folder. Open the message and automatically it will view your PDF attachment as HTML.
5. The contents of your attachment appear as HTML in a new browser window without having to download the file. When you're finished reading the attached file, close the new browser window to return to Gmail.
View 6 Replies
View Related
Aug 12, 2009
If i have a apk file and want to know the package name and class hierarchy, how do i do it?
Suppose I have some sample APK file named "SampApp.apk" which contains classes inside "com.android.sampApp".
Is there any tool in Android SDK which shows the package name when APK file is passed as a parameter.
As the Class files are compressed to dex file I am not able to check the actual package name.
View 6 Replies
View Related
Sep 18, 2010
all in my application I want to read data from web page. if data at web page is upto 800kb then I am able to read it succesfully, but if data is larger then I get OutofMemoryException.I think it is because I am using condition as while ((inputLine = in.readLine()) != null) and in phone there is not much memory to read such a long string. I think I must have to read some part of string then write that part into some file in phone and read another part of string and write into phone but I don't know how to do that? Please help me solve this issue.
View 5 Replies
View Related
Jun 28, 2010
From different post i have concluded that insertion, deletion and updation in Calendar is only possible by using g-data.
View 1 Replies
View Related
Oct 31, 2009
I am facing some problem during reading data from socket If there is some null data in socket stream so the DataInputStream would not read the full data and the so at the receiving end there is exception for parsing data.What is the right way to read the data from socket so there is no loss of data at any time ?
View 3 Replies
View Related