Pender Android for Phonegap Cordova

Discussion and feedback on Construct 2

Post » Wed Mar 20, 2013 7:55 am

Tomorrow I can for sure, now I gotta be up in 5 hours, so it's sleep time. My skype is ArcadEd

I zipped up the 2 folders in case they help.
http://www.edfarias.com/arcaded.zip

Thanks again.

If you want to post what to try go for it, I can try it first thing tomorrow.ArcadEd2013-03-20 07:56:19
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Wed Mar 20, 2013 7:57 am

ok, no worries, I see the problem in project.properties, we can fix it easy

simple problem: the android library reference has to be given as a relative offset from the root of your project,
so instead of

android update project --path <projectpath> --library <librarypath>

it should be

update project --path <projectpath> --library <offset/path/to/library/from/project/root>


in your case, that's:

android update project --path arcaded --library ../PenderAndroidLibrarylorinbeer2013-03-20 08:00:29
B
4
Posts: 40
Reputation: 382

Post » Wed Mar 20, 2013 8:07 am

both are in the root of my z drive.

I did android update project --path z:\arcaded --library z:\PenderAndroidLibrary

so instead I should do it as:
android update project --path z:\arcaded --library ../PenderAndroidLibrary
??


OK, I got it to build.
I just get a FORCE CLOSE on droid device. :)ArcadEd2013-03-20 08:37:47
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Wed Mar 20, 2013 2:53 pm

what does the log say when the app boots up?

do this:
adb logcat

that will bring up the log, and show you a stacktrace of the error
B
4
Posts: 40
Reputation: 382

Post » Wed Mar 20, 2013 3:02 pm

I/PackageManager( 1638): setEnabledSetting(), pkgName=com.tunewiki.lyricplayer.
android, clsName=com.tunewiki.lyricplayer.android.common.NotificationsAlarmManag
er$BootAndMediaMountReceiver, state=1, flag=1, pid=29328, uid=10041
D/DEBUG   ( 1813): updateCellLayoutCache(3.5555556, 3.5607476)
D/PowerManagerService( 1638): New lightsensor value:160, lcdValue:94
D/PowerManagerService( 1638): lightSensorChangedLocked, buttonValue >= 0, mPower
State = 3
I/Process (29309): Sending signal. PID: 29309 SIG: 9
D/InputManagerService( 1638): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy@40d05048
I/ActivityManager( 1638): Process com.arcaded (pid 29309) has died.
D/PeopleApp( 2189): Auto requerying AllPeopleCursor due to update - 25 contacts
D/dalvikvm( 7591): GC_EXPLICIT freed 14K, 39% free 4658K/7623K, external 1K/751K
, paused 64ms
D/Background traffic light( 1813): traffic light: GREEN, mBackgroundTrafficLight
= false
D/AutoSetting( 1914): service - mRequestRunnable: screen on delay 10s, request N
LP now
D/AutoSetting( 1914): service - requestNLP() to last request within 2hrs, don't
request 250019
V/HtcAppUsageStats( 1638): handleMessage msg=1
I/ActivityManager( 1638): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.arcaded/.arca
ded } from pid 1813
V/HtcAppUsageStats( 1638): (launch app, package): (arcaded, com.arcaded)
D/PhoneWindow( 1813): couldn't save which view has focus because the focused vie
w com.android.internal.policy.impl.PhoneWindow$DecorView@40568e28 has no id.
D/Background traffic light( 1813): traffic light: GREEN, mBackgroundTrafficLight
= true
I/ActivityManager( 1638): Start proc com.arcaded for activity com.arcaded/.arcad
ed: pid=29336 uid=10130 gids={}
D/SensorService( 1638): enable: get sensor name = BMA150 3-axis Accelerometer
D/Sensors ( 1638): Enable akm: en = 1
D/SensorService( 1638): pid=1638, uid=1000
D/AK8975 ( 1525): Compass Start
D/AK8975 ( 1525): Ignore M_Sensor: (y, p, r) = ( 133,   -3,    0), Status = 3
D/AndroidRuntime(29336): Shutting down VM
W/dalvikvm(29336): threadid=1: thread exiting with uncaught exception (group=0x4
001d5a0)
E/AndroidRuntime(29336): FATAL EXCEPTION: main
E/AndroidRuntime(29336): java.lang.RuntimeException: Unable to instantiate activ
ity ComponentInfo{com.arcaded/com.arcaded.arcaded}: java.lang.ClassNotFoundExcep
tion: com.arcaded.arcaded in loader dalvik.system.PathClassLoader[/data/app/com.
arcaded-1.apk]
E/AndroidRuntime(29336):        at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:1743)
E/AndroidRuntime(29336):        at android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:1851)
E/AndroidRuntime(29336):        at android.app.ActivityThread.access$1500(Activi
tyThread.java:132)
E/AndroidRuntime(29336):        at android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:1038)
E/AndroidRuntime(29336):        at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime(29336):        at android.os.Looper.loop(Looper.java:150)
E/AndroidRuntime(29336):        at android.app.ActivityThread.main(ActivityThrea
d.java:4293)
E/AndroidRuntime(29336):        at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(29336):        at java.lang.reflect.Method.invoke(Method.java:5
07)
E/AndroidRuntime(29336):        at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(29336):        at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:597)
E/AndroidRuntime(29336):        at dalvik.system.NativeStart.main(Native Method)

E/AndroidRuntime(29336): Caused by: java.lang.ClassNotFoundException: com.arcade
d.arcaded in loader dalvik.system.PathClassLoader[/data/app/com.arcaded-1.apk]
E/AndroidRuntime(29336):        at dalvik.system.PathClassLoader.findClass(PathC
lassLoader.java:240)
E/AndroidRuntime(29336):        at java.lang.ClassLoader.loadClass(ClassLoader.j
ava:551)
E/AndroidRuntime(29336):        at java.lang.ClassLoader.loadClass(ClassLoader.j
ava:511)
E/AndroidRuntime(29336):        at android.app.Instrumentation.newActivity(Instr
umentation.java:1040)
E/AndroidRuntime(29336):        at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:1735)
E/AndroidRuntime(29336):        ... 11 more
W/ActivityManager( 1638):   Force finishing activity com.arcaded/.arcaded
W/dalvikvm( 1813): disableGcForExternalAlloc: false
W/System.err( 7676): java.io.IOException: Permission denied
W/System.err( 7676):    at java.io.File.createNewFileImpl(Native Method)
W/System.err( 7676):    at java.io.File.createNewFile(File.java:1257)
W/System.err( 7676):    at com.idreamsky.lib.g.k.a(SourceFile:254)
W/System.err( 7676):    at com.idreamsky.gamecenter.service.a.a(SourceFile:102)
W/System.err( 7676):    at com.idreamsky.gamecenter.service.a.b(SourceFile:78)
W/System.err( 7676):    at com.idreamsky.gamecenter.service.c.handleMessage(Sour
ceFile:328)
W/System.err( 7676):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 7676):    at android.os.Looper.loop(Looper.java:150)
W/System.err( 7676):    at android.os.HandlerThread.run(HandlerThread.java:60)
W/System.err( 7676):    at com.idreamsky.gamecenter.service.a.run(SourceFile:173
)
W/ActivityManager( 1638): Activity pause timeout for HistoryRecord{4057ffa0 com.
arcaded/.arcaded}
D/SensorService( 1638): disable: get sensor name = BMA150 3-axis Accelerometer
D/Sensors ( 1638): Enable akm: en = 0
D/SensorService( 1638): pid=1638, uid=1000
I/CarouselTimeLog( 1813): onStart() finish: 1363791660737
D/CarouselDummyActivity( 1813): CarouselDummyActivity.onResume: tab_allapps
D/Background traffic light( 1813): traffic light: RED, mBackgroundTrafficLight =
true
D/William ( 1813): - refreshUsageStatCache -
D/AK8975 ( 1525): Compass CLOSE



If that helps. I might try the whole process from start to finish again today just making sure I don't miss anything.ArcadEd2013-03-20 15:03:49
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Wed Mar 20, 2013 3:08 pm

Yeah, the stack trace seems to indicate that it can't load your main activity, which doesn't have anything to do with Pender perse. It's claiming it can't find your main activity class in the package it compiles from your main activity class . Gotta love Eclipse.

can you zip up your whole project folder and send it to me? If I can see the code, I can probably sort this out in under 30 seconds,<swordfishref> with John Travolta pointing a gun at my head and yelling at me to hack </swordfishref> lorinbeer2013-03-20 15:09:01
B
4
Posts: 40
Reputation: 382

Post » Wed Mar 20, 2013 3:22 pm

sure, same link as before
http://www.edfarias.com/arcaded.zip
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Wed Mar 20, 2013 3:58 pm

I GOT IT!!

This part. I had to change the PenderActivity to match the name of my project. In my other attempt I let eclipse fix it for me without reading :).


import android.app.Activity;
import android.os.Bundle;

import com.pender.Pender;

public class PenderActivity extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        mPender = new Pender(this);
        mPender.init();
    }

    private Pender mPender;    
}
ArcadEd2013-03-20 15:59:47
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Wed Mar 20, 2013 4:02 pm

ok dude, easy fix!

the android project specifies your main activity as arcaded, but that's not present in your project.

rename src/com/arcaded/PenderActivity.java to src/com/arcaded/arcaded.java

then change the Activity Class name to match

public class PenderActivity extends Activity

to

public class arcaded extends Activity


that got the project working! Remember to disconnect the debbuger or unplug the phone from the machine once it's running, and behold 50 sprites rendering at 30fps, each with it's own texture bind event (equivalent to 50 unique sprites!)


-- edit --
lol, missed your fix before posting, good work mate! How's it look? What device are you running it on?lorinbeer2013-03-20 16:03:24
B
4
Posts: 40
Reputation: 382

Post » Wed Mar 20, 2013 4:02 pm

Now the big next question or 2 :).

1. What do I do to include my HTML5 project? In the past I would build the app with eclipse and phonegap. Creating a www directory under assests and including all my html5 files, phonegap.js and referencing phonegap.js in the index.html

2. Are you working on IOS support as well?

3. You the manArcadEd2013-03-20 16:04:13
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests