TMT3 Problem - only show blue screen, no button shown

89 views
Skip to first unread message

Joshuatly Tee Lien Yu

unread,
Mar 29, 2012, 3:55:38 AM3/29/12
to eclipse-plugi...@googlegroups.com
Hey there,

I am very new to android development, and when i try out TMT3 step by step, when i run the code on my phone, it give me only the blue background colour. nothing more. What should I do or give to let you guys help me? 

Attached is the logcat file output.

Regards,
joshuatly
log.txt
Message has been deleted

Elizabeth Baldwin

unread,
Mar 29, 2012, 11:13:13 AM3/29/12
to eclipse-plugi...@googlegroups.com
Hello. What device/Android version are you using?

 I noticed the meta tags were somewhat messy. I'm changing
the source attached to the tutorial, so that index.html is now:

After <head> add lines:
      <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
      <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">

Remove 2 lines:
    <meta http-equiv="Content-type" name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
     <meta name="viewport" content="width=screen.width; user-scalable=no" />

However, on all the platforms I've tested, I've not seen what you
are describing (custom background color, and no buttons?). But please
make these changes.. and confirm that index.html does define buttons.
I'll paste the complete <head> below.

If this doesn't help.. in Logcat, please "Clear Log", then run the app, then
Select All in logcat, save all with "Export Selected Items to Text File".

Libby

  <head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
    <title>Bar Code Scanner</title>
    <link rel="stylesheet" href="main.css" type="text/css">
    <script type="text/javascript" charset="utf-8" src="phonegap-1.4.1.js"></script>
    <script type="text/javascript" src="barcodescanner.js"></script>
    <script type="text/javascript" src="main.js"></script>
  </head>

joshuatly

unread,
Apr 6, 2012, 6:01:44 AM4/6/12
to eclipse-plugi...@googlegroups.com
I tried it on my Desire Z (flashed rom MIUI Android 4.0 ICS and now currently using cyanogenmod 7 RC).
 Am still having problem. Attached is the screenshot of the result. And here is my export of my project files. (http://www.mediafire.com/?fbqftyq1or4dgq9) Can anyone help me to check where do i did wrong? I had checked several times still cannot find whats wrong. Thanks


Joshua Tee Lien Yu
Please visit my blog at www.joshuatly.com
screenshot-1333705796816.png

Libby

unread,
Apr 6, 2012, 12:18:47 PM4/6/12
to eclipse-plugi...@googlegroups.com
Look at the head section in index.html:

<script type="text/javascript" scr="main.js">/<script>

The line above is almost a duplicate of a line 4 above,
but with a type-o's: scr= and >/<.

Correct and/or move the earlier line down after barcodescanner.js.

Libby

joshuatly

unread,
Apr 6, 2012, 2:06:07 PM4/6/12
to eclipse-plugi...@googlegroups.com
Another question about the tutorial. in part 9 do i require to do anything?
I didnt do anything in the part 9, im getting this application has stopped unexpectedly on my phone... any tips please?

Regards,

Joshua Tee Lien Yu
Please visit my blog at www.joshuatly.com


joshuatly

unread,
Apr 6, 2012, 2:12:51 PM4/6/12
to eclipse-plugi...@googlegroups.com
Here is the log (just in case):
04-06 17:46:35.810: D/DroidGap(2358): DroidGap.startActivityForResult(intent,-1)
04-06 17:46:35.830: D/AndroidRuntime(2358): Shutting down VM
04-06 17:46:35.830: W/dalvikvm(2358): threadid=1: thread exiting with uncaught exception (group=0x40015560)
04-06 17:46:35.830: E/AndroidRuntime(2358): FATAL EXCEPTION: main
04-06 17:46:35.830: E/AndroidRuntime(2358): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.joshuatly.testqr2/com.google.zxing.client.android.encode.EncodeActivity}: java.lang.ClassNotFoundException: com.google.zxing.client.android.encode.EncodeActivity in loader dalvik.system.PathClassLoader[/data/app/com.joshuatly.testqr2-1.apk]
04-06 17:46:35.830: E/AndroidRuntime(2358): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1680)
04-06 17:46:35.830: E/AndroidRuntime(2358): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
04-06 17:46:35.830: E/AndroidRuntime(2358): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
04-06 17:46:35.830: E/AndroidRuntime(2358): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
04-06 17:46:35.830: E/AndroidRuntime(2358): at android.os.Handler.dispatchMessage(Handler.java:99)
04-06 17:46:35.830: E/AndroidRuntime(2358): at android.os.Looper.loop(Looper.java:130)
04-06 17:46:35.830: E/AndroidRuntime(2358): at android.app.ActivityThread.main(ActivityThread.java:3835)
04-06 17:46:35.830: E/AndroidRuntime(2358): at java.lang.reflect.Method.invokeNative(Native Method)
04-06 17:46:35.830: E/AndroidRuntime(2358): at java.lang.reflect.Method.invoke(Method.java:507)
04-06 17:46:35.830: E/AndroidRuntime(2358): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
04-06 17:46:35.830: E/AndroidRuntime(2358): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
04-06 17:46:35.830: E/AndroidRuntime(2358): at dalvik.system.NativeStart.main(Native Method)
04-06 17:46:35.830: E/AndroidRuntime(2358): Caused by: java.lang.ClassNotFoundException: com.google.zxing.client.android.encode.EncodeActivity in loader dalvik.system.PathClassLoader[/data/app/com.joshuatly.testqr2-1.apk]
04-06 17:46:35.830: E/AndroidRuntime(2358): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-06 17:46:35.830: E/AndroidRuntime(2358): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-06 17:46:35.830: E/AndroidRuntime(2358): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-06 17:46:35.830: E/AndroidRuntime(2358): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-06 17:46:35.830: E/AndroidRuntime(2358): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1672)
04-06 17:46:35.830: E/AndroidRuntime(2358): ... 11 more
04-06 17:46:37.902: I/Process(2358): Sending signal. PID: 2358 SIG: 9

Libby

unread,
Apr 9, 2012, 11:37:41 PM4/9/12
to eclipse-plugi...@googlegroups.com
Hey Joshua -

How's it going? No, Part 9 is just a review of the
handlers for scan and encode.

Almost all the problems I hear about with TMT3 have
to do with the many details of creating the library and
app projects. Suggesting to re-read or even re-do the
tutorial a 2nd time usually spots the problem. Make
sure you are clear on the library vs. app project parts,
and the library configuration parts of each project.

I've attached my AndroidManifest.xml file from the app
project. The differences should only be related to package
and app name.

Libby
AndroidManifest.xml

joshuatly

unread,
Apr 10, 2012, 6:15:07 AM4/10/12
to eclipse-plugi...@googlegroups.com
OK I will redo it again. Thanks

Libby

unread,
Apr 10, 2012, 12:55:03 PM4/10/12
to eclipse-plugi...@googlegroups.com
I may have just run into a similar problem.
What I did to fix it:

Project > Clean...  (clean both app and lib projects)

In app project: Right-click > Properties > Android > Library ->
deselect the library that was added, click Apply and OK
(will cause project errors)

Do same step as above, but re-add the library project, Apply
and OK (project errors disappeared, app ran normally).

HTH,
Libby

joshuatly

unread,
Apr 10, 2012, 2:08:51 PM4/10/12
to eclipse-plugi...@googlegroups.com
Thanks a lot, it solved my problem! YAY!
Thanks for the help!
 
Regards,
Joshua Tee Lien Yu
Please visit my blog at www.joshuatly.com


Libby

unread,
Apr 10, 2012, 4:41:49 PM4/10/12
to eclipse-plugi...@googlegroups.com
Great!  Thanks for letting us know.

I can't really explain, except that the projects seem to
get in a state where they need extra cleaning.

Libby

Joshuatly Tee Lien Yu

unread,
Apr 12, 2012, 6:05:14 AM4/12/12
to eclipse-plugi...@googlegroups.com
I think you need to update the tmtp2 link to your github instead of the phonegap one. cos if i use the phonegap one it wont work for 1.4.1.

Libby

unread,
Apr 12, 2012, 12:50:35 PM4/12/12
to eclipse-plugi...@googlegroups.com
Yes, you are right! Thanks for pointing that out.

Sorry about the confusion. Until Cordova/PhoneGap and all Cordova
Plugins are stabilized and updated - we'll all need to be aware of 
versioning issues. :(

Cheers,
Libby
Reply all
Reply to author
Forward
0 new messages