Android Attack! “All about the Errors”

So in the first week of android development, I was riddled with errors. Not even stemming from coding, but in the setup process. Which at times can damper your progression, especially when you’re excited to go and make an app!

The first error I hit was Eclipse not being able to read my SDK. Which was easy to fix, just had to redirect where the SDK was downloading everything. Then BOOM! I was ready to go again. Now you must know I’m going off of Lynda’s Android Essential Training (Yay to free month!). Then from there I’ll, resort to googling and other tutorials on the net.

Error two that bummed me out was not being able to set up an virtual device environment. Which hasn’t been fixed with Android Studio finally being released, so I’m just using my Nexus 4 and 5 as the environment. Which in all honesty is fine since I can touch and feel how the app works. What makes me sad is that I want to be able to test from my chromebook (using chrome remote desktop)! Soon enough I’ll be buying a laptop dedicated to coding, but as for right now it’s just a pain in the but…

And finally the Gradle error I got after installing Android Studio… I have NO idea what it’s suppose to even do… Searching on stackoverflow.com, I got the consensus of it being a build tool… cool? I still don’t know what it does, and why I get this error: Gradle dsl method not found. So i resorted to installing Android Studio again (I was using the beta, then upgraded). Looked around for what it may be hopefully I can get a fix for this damn thing!

Now to the GOOD AWESOME THING, I know how to move between activities! It’s the little things I tell ya!

Here is the code I need to run in my main activity java file:

public void gotoActivity(View v) {
    Intent intent = new Intent (this, DetailActivity.class);
    startActivity(intent);
}

This is what you call; Explicit Intent. Which is an messaging object you can use to request an action from another app component (straight from develop.android!).

Now in my activity main xml, I inserted:

android:onClick=”gotoActivity”

From there you run your app and press the button you prompted on your main activity to another activity(es).

Very easy process but of course this blog wouldn’t be complete without an error! After watching the tutorial I went gung ho, and had a daring TWO buttons on my main screen! One was labelled “Join!” the other “Click Me”.

Here is the code I had running in the main java:

(Join button)

public void gotoActivity(View v) {
   Intent intent = new Intent (this, DetailActivity.class);
   startActivity(intent);
}

(Submit button)

public void gotoSubmit(View s) {
   Intent intent = new Intent (this, SubmitActivity.class);
   startActivity(intent);
}

Then I ran the app on my Nexus 5 and everytime I hit the “Join” button, it crashed the app and kicked me out. Which led me to be fixated on the above code and the ones in the activities, in turn has led me no where… Hopefully I find out what I did wrong… To Be Continued!

Hug someone! -Randy

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s