anyone using Android Studio?

Since I started off with Android Studio to learn app development, I'm sticking with it.

I imported the API as a non Android Studio project and used Refactor > Rename because the sample-app looks for MetaWearAPI. Anything else I would need to do? It built fine (far as I know, I'm a newbie). Does something need to be done to convert this project into a "library"?

When I try building the Sample App, I get a tonne of errors like 

Error:(35, 53) error: package com.mbientlab.metawear.api.MetaWearController does not exist
Error:(36, 34) error: package com.mbientlab.metawear.api does not exist
Error:(37, 45) error: package com.mbientlab.metawear.api.controller does not exist
Error:(38, 50) error: package com.mbientlab.metawear.api.controller.GPIO does not exist

Which seem to arise from the import lines in the java files.

Again, I'm a newbie with java and app design, so any help will be super.

Thanks!

Comments

  • You need to add the metawear api to the java build path.  Source and jar files are available here:
  • Thanks Eric,
              Could I get more detail? Where in the Android Studio setup would I put the path. If I download the Metawear-AndroidAPI from github, how exactly should I proceed if I'm using A Studio rather than Eclipse?

    Thanks
  • I'm going to try using a JAR to build the app in Android studio. I have a question about where I might find the metawearapi.jar. When I download from github and extract, I have a folder called Metawear-AndroidAPI-master.

    The doc https://www.mbientlab.com/docs/MetaWearAndroidAPIGSGv1.0.pdf suggests that there would be a bin directory in the first level (after descending into) but there isn't. 

    Is this .jar only expected to exist if one follows a build procedure in Eclipse or might there be a way to get there using Android Studio?

    Thanks
  • I did this and now I get the .jar

    Import the project into Eclipse
    Check that the JDK compiler compliance level is 1.7 ( This can be view and/or changed in the project properties menu, under the "Java Compiler" section)
    Select Project -> Build Project from the top menu

    It would be good to have a migration howto to go from Eclipse to Android Studio though :)
  • I had a lot of issues getting started with the github android API in studio.  the sample app seemed to go a lot smoother on import.
  • I will be moving the code over to Android Studio in the future, as Eclipse is no longer supported.  The last time I tried using Android Studio (back in October), I was disappointed by the lack of basic IDE features (i.e. autocompleting imports, generating method stubs for interfaces, etc.) so I put off the migration for now.  
  • It's really sad that A Studio doesn't have basic stuff like a wizard to customize your app icon - when Eclipse already has it.

    That being said, I think development based on MetaWear would move faster if we support the latest dev environment, so happy to see your reply. Any idea when?

    At least no one's asking for a Windows phone app.
  • I will not be making the transition until after we have all the features for firmware v1.0 supported in the Android API.

    Another user has asked for Windows phone support, then decided to make his own library using the Android code as a reference.  

  • Would you support pull request on this?
  • I import Metawear API 1.4 as library for Metawear app,but there are something wrong.
    As the following error, what's wrong with it?

    import com.mbientlab.metawear.api.MetaWearController;
    import com.mbientlab.metawear.api.Module;
    import com.mbientlab.metawear.api.MetaWearController.DeviceCallbacks;
    import com.mbientlab.metawear.api.controller.IBeacon;

  • I imported metawearapi 1.4 and metawearapp 2.4 in Android Studio and encounter the following errors.
    Error:(19, 9) Execution failed for task ':metaWearApp:processDebugManifest'.
    > Manifest merger failed : Attribute application@icon value=(@drawable/metawear_logo) from AndroidManifest.xml:19:9
      is also present at MetaWearApp:metaWearAPI:unspecified:13:9 value=(@drawable/ic_launcher)
       Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:17:5 to override 
    So what to do in the next step?
  • Try the suggestion in the error message:

    Error:(19, 9) Execution failed for task ':metaWearApp:processDebugManifest'.
    > Manifest merger failed : Attribute application@icon value=(@drawable/metawear_logo) from AndroidManifest.xml:19:9
       is also present at MetaWearApp:metaWearAPI:unspecified:13:9 value=(@drawable/ic_launcher)
       Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:17:5 to override 
  • Do you guys imported the sample app in Android Studio?
    How did you do it?
    Thanks,
  • Did you guys check-out http://docs.mbientlab.com. Eric posted youtube videos on getting started with Android Studio.
This discussion has been closed.