39 Replies - 6156 Views - Last Post: 30 April 2012 - 04:08 AM

Stuck with Android conversion.

Posted 26 April 2012 - 06:28 PM

Hello there, I have hit a brick wall when I have been attempting to convert my Java code into Android compatible Java. Everytime I try and load it, I get a critical error. There is a lot missing from it, such as controls but I would have thought that it would have compiled regardless.

Re: Stuck with Android conversion.

Posted 29 April 2012 - 04:44 PM

After just quickly looking through your code, and in GameModel.java i didn't where you set the context. You are trying to get the Assets from the context that's not set. What's why you are getting this error.

In GameModel.java, try changing gameStart() to gameStart(Context context)
and then in GameSurfaceView.java change model.gameStart(); to model.gameStart(this);

Re: Stuck with Android conversion.

Posted 29 April 2012 - 05:22 PM

Okay, sorry. My bad.
But i do not see where you set the value of, or initialize "canvas"
I see the variable and that you use it when you adds a rect to the LinkedList, but that's all i see you doing with it.