How can I create an array of resource files in J2ME
Array of Resource Files
Collapse
X
-
Tags: None
-
if you have your images in your resources, it has no sense to have them in an array: you've already them in a collection (resorices) from which you can get any by name, and the name is a string you can build
Private Function GetImageResourc eByName(ByVal picNumber As Integer) As Bitmap
Dim picName As String = "DL" & picNumber.ToStr ing
Return DirectCast(My.R esources.Resour ceManager.GetOb ject(picName), Bitmap)
End Function -
Thanks. It is an array of *.txt files.
I am trying to build something like a library of books, chapter, verses and text. all the chapters are in different txt files as resources. To put them in an array so that I will be able to use
Record Store to call any verse.
Is it possible to use
Code:private String Matthew(){ InputStream is = getClass().getResourceAsStream("*.txt"); StringBuffer sb = new StringBuffer(); try{ int chars, x = 0; while ((chars = is.read()) != -1){ sb.append((char) chars); } return sb.toString(); }catch (Exception e){} return null; }
Comment
Comment