Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Josh Gold
12,207 PointsCan I use Android Studio for Systemizer project?
Would like to avoid setting up IntelliJ when I already have Android Studio. But I am not getting any output for the first exercise except Hello World! Here is my code below. I do have Systemizer class and java files in place. <br><br>
package com.joshbgold.systemizer;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import java.util.Set;
import java.util.TreeSet;
public class MainActivity extends AppCompatActivity {
public static void main(String[] args) {
System.out.printf("This is the classpath: %s %n",
System.getProperty("java.class.path"));
Set<String> propNames = new TreeSet<String>(System.getProperties().stringPropertyNames());
for (String propertyName : propNames) {
System.out.printf("%s is %s %n",
propertyName,
System.getProperty(propertyName));
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Josh Gold
12,207 PointsHello Ben, I previously tried putting the code into the onCreate method. I didn't get any output from that. Maybe because I am not passing in the required String[] args?
Josh Gold
12,207 PointsOk, what I was thinking would be a shortcut (just using Android Studio) was not a shortcut. I just installed IntelliJ and completed the task successfully. Thanks for your recommendation Ben that allowed me to move forward!
1 Answer
Ben Deitch
Treehouse TeacherHmm not sure. I'd probably just do it in IntelliJ. Android Studio isn't great for Java development.
Ben Deitch
Treehouse TeacherBen Deitch
Treehouse TeacherAndroid doesn't use a 'main' function. Id' try putting the code into the bottom of onCreate.