Background
Recently Android-Studio has reached RC version, and I thought of giving it (another) try.
This, and the fact that Lollipop was announced, along with nice cool features on Android-Studio.
The problem
I wanted to try out the samples of the new Lollipop version, but as opposed to Eclipse which has the ability to create a project of the API-Demos (which sadly has become "legacy" and has annoyingly more steps to import), I couldn't find how to do it on Android-Studio.
What I've tried
The only thing I've found is single projects, here.
Sadly, not only it's annoying to import them one after another (yet maybe it's better than a huge project), but I've also failed to do it. This is the instructions:
- Unpack the downloaded project package.
- In Android Studio, chose File > Import Project and select the root folder of the unpacked project. Android Studio may ask you to choose the type of project you are importing. If this is the case, make sure to choose Import project from external model and select the Gradle option.
So, I've taken one sample from here , which is supposed to show how to use the new transition mechanism on Lollipop.
I've opened Android Studio, and I can't find any "File" menu:
I've tried using the "open an existing android studio project" , but this caused this error:
I've also tried other solutions, such as creating a new Android app and import the other project, and also use "import non android studio project". I've even tried importing it to Eclipse (and succeeded), but then it crashed on this exception:
11-23 18:07:20.950: E/AndroidRuntime(2141): Process: com.example.android.activityscenetransitionbasic, PID: 2141
11-23 18:07:20.950: E/AndroidRuntime(2141): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.activityscenetransitionbasic/com.example.android.activityscenetransitionbasic.MainActivity}: java.lang.RuntimeException: Unknown scene name: moveImage
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.app.ActivityThread.access$800(ActivityThread.java:144)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.os.Handler.dispatchMessage(Handler.java:102)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.os.Looper.loop(Looper.java:135)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.app.ActivityThread.main(ActivityThread.java:5221)
11-23 18:07:20.950: E/AndroidRuntime(2141): at java.lang.reflect.Method.invoke(Native Method)
11-23 18:07:20.950: E/AndroidRuntime(2141): at java.lang.reflect.Method.invoke(Method.java:372)
11-23 18:07:20.950: E/AndroidRuntime(2141): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
11-23 18:07:20.950: E/AndroidRuntime(2141): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
11-23 18:07:20.950: E/AndroidRuntime(2141): Caused by: java.lang.RuntimeException: Unknown scene name: moveImage
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.transition.TransitionInflater.createTransitionFromXml(TransitionInflater.java:177)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.transition.TransitionInflater.createTransitionFromXml(TransitionInflater.java:181)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.transition.TransitionInflater.inflateTransition(TransitionInflater.java:77)
11-23 18:07:20.950: E/AndroidRuntime(2141): at com.android.internal.policy.impl.PhoneWindow.getTransition(PhoneWindow.java:3696)
11-23 18:07:20.950: E/AndroidRuntime(2141): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3657)
11-23 18:07:20.950: E/AndroidRuntime(2141): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:367)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.app.Activity.setContentView(Activity.java:2144)
11-23 18:07:20.950: E/AndroidRuntime(2141): at com.example.android.activityscenetransitionbasic.MainActivity.onCreate(MainActivity.java:47)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.app.Activity.performCreate(Activity.java:5933)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
11-23 18:07:20.950: E/AndroidRuntime(2141): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
The question
How do I really import sample apps into Android-Studio?
Is the new website the new, official way to do it?
Also, how do I do it correctly for Eclipse? It seems to be missing SMS handling classes/functions on the files "MmsMessagingDemo.java" and "MmsWapPushReceiver.java". Only if I make them as comments, it compiles fine.
Check out this link it contains a solution for moveImage error:
It says
Like this:
Go to:
And make sure to check the ids in "target" tag; you must have them in your layout.