[mdlug] Crush Kill Destroy 2: creating apps

Drew drew4096 at gmail.com
Wed Jun 28 12:00:53 EDT 2017


On 6/28/17, Raymond Ingles <sorceror171 at gmail.com> wrote:
> I've written and sold an Android app: http://perpendox.com/phem/
>
> Do you have a specific question?
>

 I'm getting a compiler error (actually two of them) on each of two
class.methods that I try for displaying generated output on the
screen. The offending lines are

tview.setText(data_text);
and
iview setImageBitmap(oimage);

where tview and iview are a TextView and an ImageView respectively,
data_text is a string, and oimage is a Bitmap. In each case I get two
<identifier> expected errors, one pointing to each parenthesis. This
code is copied almost word for word from Android tutorial web pages.

I've examined the relevant classes in the android.jar that I'm using
(from Terminal IDE) and they seem to contain the necessary methods.

I'm attaching my MainActivity.java, main.xml, and compiler output.
-------------- next part --------------
rm: can't remove 'src/org/me/androiddemo/R.java': No such file or directory
Create the R.java file
res/layout/main.xml:12: error: Error parsing XML: not well-formed (invalid token)
Locale/Vendor pairs:
   /

Files:
  layout/main.xml
      Src: res/layout/main.xml
  values/strings.xml
      Src: res/values/strings.xml
  AndroidManifest.xml
      Src: AndroidManifest.xml
Including resources from package: /data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar
applyFileOverlay for drawable
applyFileOverlay for layout
applyFileOverlay for anim
applyFileOverlay for xml
applyFileOverlay for raw
applyFileOverlay for color
applyFileOverlay for menu
    (new resource id main from res/layout/main.xml)
Compile the java code
USER CLASS PATH : ../libs/demolib.jar
SOURCE CLASS PATH : .
[parsing started RegularFileObject[org/me/androiddemo/MainActivity.java]]
org/me/androiddemo/MainActivity.java:66: <identifier> expected
    tview.setText(data_text);    
                 ^
org/me/androiddemo/MainActivity.java:66: <identifier> expected
    tview.setText(data_text);    
                           ^
org/me/androiddemo/MainActivity.java:69: <identifier> expected
    iview.setImageBitmap(oimage);
                        ^
org/me/androiddemo/MainActivity.java:69: <identifier> expected
    iview.setImageBitmap(oimage);
                               ^
[parsing completed 62ms]
[total 99ms]
4 errors
Now convert to dex format

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: org: file not found
	at com.android.dx.util.FileUtils.readFile(FileUtils.java:55)
	at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:139)
	at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:113)
	at com.android.dx.command.dexer.Main.processOne(Main.java:247)
	at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
	at com.android.dx.command.dexer.Main.run(Main.java:139)
	at com.android.dx.command.dexer.Main.main(Main.java:120)
	at com.android.dx.command.Main.main(Main.java:89)
	at com.spartacusrex.spartacuside.external.dx.main(dx.java:14)
	at dalvik.system.NativeStart.main(Native Method)
processing archive ../../libs/demolib.jar...
ignored resource META-INF/MANIFEST.MF
processing org/library/libfunc.class...
1 error; aborting

THIS TOOL IS DEPRECATED. See --help for more information.

./build/resources.res does not exist
java.lang.IllegalStateException: End of central directory not found in data_android.apk
	at kellinwood.zipio.ZipInput.scanForEOCDR(ZipInput.java:125)
	at kellinwood.zipio.ZipInput.doRead(ZipInput.java:150)
	at kellinwood.zipio.ZipInput.read(ZipInput.java:76)
	at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:615)
	at com.spartacusrex.spartacuside.external.jarsigner.main(jarsigner.java:47)
	at dalvik.system.NativeStart.main(Native Method)
Sign finished..!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MainActivity.java
Type: application/octet-stream
Size: 1945 bytes
Desc: not available
URL: <http://mdlug.org/pipermail/mdlug/attachments/20170629/7898965f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.xml
Type: text/xml
Size: 578 bytes
Desc: not available
URL: <http://mdlug.org/pipermail/mdlug/attachments/20170629/7898965f/attachment.xml>


More information about the mdlug mailing list