Read text file and search contents

by CompuCor » Tue, 14 Apr 2009 00:58:41 GMT


Sponsored Links
 Greetings,

I am new to Java and Android.  I have a flat file (pipe-delimited)
stored in R.raw called wordlist.txt.  I want to open this file and
quickly search for a word I pass into my procedure.

I've been searching for a simple way to do this but not having much
luck.

Can anyone share some code on how to do this?

Thanks SO much for any help!

--~--~---------~--~----~------------~-------~--~----~



Read text file and search contents

by Charlie Collins » Tue, 14 Apr 2009 02:06:43 GMT


 Here is a basic example of reading a raw resource:
 http://unlocking-android.googlecode.com/svn/chapter5/trunk/FileStorage/src/com/msi/manning/chapter5/filestorage/ReadRawResourceFile.java. 





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. VOOT: AHA Episode Empat Tidak Tayang

Karena ada kendala operasional (walah... kayak alasan ground staff
maskapai penerbangan bila pesawat delay), hari ini "episode" keempat
layanan uji pakai AHA tidak ditayangkan. Diharapkan besok telah kembali
normal. 

Sebagai pelipur lara, ada sebuah kisah yang terjadi tadi siang dan
sampai saat ini masih membuat saya tersenyum sendiri kala mengingatnya.
Tiga paragraf awal saya copy paste-kan di sini. Kalau masih ingin
membaca lanjutannya, silakan masuk ke http://ponselmu.com/2010/07/01/laptop/



Salam,


Herry SW

===

Kisah ini terjadi tadi siang, 1 Juli 2010, sekitar pukul 12.00.

Saya masih harus menuntaskan ketikan naskah seputar ponsel. Meluncurlah
saya ke Plaza Tunjungan (TP), pusat perbelanjaan teramai dan terbesar di
Surabaya.

engetik di Starbucks saja deh,gumam saya dalam hati. Harga minuman
di sana memang tidak terlalu murah. Namun, saya suka dengan perilaku
staf di sana. Biarpun saya hanya membeli segelas minuman, lalu mengetik
berjam-jam, tak ada bahasa tubuh yang bermakna engusiran

-- 
"Indonesian Android Community [id-android]" 

2. live stream error

I am making a basic activity to stream this live show
http://ice2.securenetsystems.net/WHBRM  here is the pastebin of my
activity http://pastebin.com/N5g69j7i

I realize that it is better to be in a service but this is just a
test.  Anyways it seems to be working fine except for in froyo my
error listener gets an unknown error about every 10 seconds.
Infolistener and bufferinglistener are also never called.

my hack of sorts using the errorlistener to catch the error and
restart the stream is working but since the error happens every 10
seconds or so it is making the audio very choppy.

I also get a system log that says MediaPlayer error (1, -2147483648)
before each crash
also AwesomePlayer Not sending buffering status because duration is
unknown.

I assume the second error is because its a live stream and it has no
end, however how do you handle that case.

Thanks in advance!

-- 

3. am i using these correctly? AbsListView.layoutparams

4. Audio

5. init.rc commands not interprete

6. what are the contents of the en.us/*.par files?

7. init.rc commands not interpreted