Building an Android ROS app in Eclipse - android

I have ros, rosjava, and android_core on my Ubuntu machine, as well as Eclipse and the Android SDK and ADT. Now, I'm trying to create an android application using the following instructions but I'm having trouble:
http://docs.rosjava.googlecode.com/hg/android_core/html/getting_started.html#getting-started
After copying the android_tutorial_pubsub into another folder and trying to open it with Eclipse I get a bunch of unrecognized packages. Eclipse doesn't know where to find ros classes (such as RosActivity) and I'm not sure how to import them. I tried importing the android_core as per: http://ros.org/wiki/android_core#Eclipse_configuration and that creates another project called MasterChooser that I can then link to the pubsub tutorial to fix some of the referencing errors, but the projects (pubsub and MasterChooser) still don't recognize certain files that are in rosjava. For this I tried File->Import->General->File System and then manually select the rosjava packages but that still leaves some issues.
Overall I feel there must be a simpler way to make the android app (pubsub) reference both android_core and rosjava, but my lack of experience in ros and in eclipse are making this hard. In short, I really just want to be able to run the tutorial apps (like pubsub) from Eclipse into my android device.

Related

Multiple APK inside Android Studio Like Eclipse

For some reason I can't find a clear cut answer to this. I am currently using Eclipse for my Android projects and as you can see from the screenshot my workspace has multiple APK projects, hundreds to be exact.
The reason for doing this is because it is easy to copy and reuse projects within the same workspace very quickly.
My question is, can this setup be done in Android Studio? I can't tell if it's one APK per Android Studio, or you can work with multiple in the same instance sharing dependencies like Eclipse did.
I am currently using Eclipse for my Android projects and as you can see from the screenshot my workspace has multiple APK projects, hundreds to be exact.
Been there, done that, found it to be unusable, except by keeping most of the projects closed, as it appears that you are doing based on your screenshot.
The reason for doing this is because it is easy to copy and reuse projects within the same workspace very quickly.
In Android Studio, you copy and reuse projects by coping the directory, using your development OS' file manager, the command line, or your favorite other file-management tool.
can this setup be done in Android Studio?
Not really. Android Studio supports a project having multiple modules, where those modules can be apps or libraries. There is certainly nothing stopping you from attempting to create a single Android Studio project consisting of hundreds of modules. However, they would all be the equivalent of open projects in Eclipse (actionbarsherlock and com.exposure.0 in your screenshot). I would expect Android Studio's performance to be worse than Eclipse's with hundreds of open projects, assuming that Android Studio did not flat-out crash due to running out of memory.
I was able to do it just fine without any issues. I was able to set two projects as Android projects in the settings.gradle file and just choose which one I want to launch. Hopefully over 300 of these doesn't start a performance issue. If it does I will just need to remove the modules and add the correct ones when exporting a new APK.
settings.gradle
include ':comexposure0', ':comexposure5', 'exposurelibrary'

Why don't we have a single file to open an Android Studio Project?

Why don't we have a file similar to the .xcodeproj (for XCode applications) or an .xds (for Sencha Architect Projects) for our Android Studio Project?
I'm pretty sure a good number of you here have experienced the frustration of trying to import a project you see online in order to piece it apart better and learn how it works. I get that we are supposed to Import Android Projects built using Eclipse and Open Android Projects built using Android Studio.
However, why is it that we have to go through File -> Open -> then pick out the directory of the Android Studio app that we want to open? And the thing is, Android Studio doesn't seem to know it's an Android Studio project until it tries to open and build it. In the screenshot I have below, I have the sample Android Studio projects of ARToolKit, but I've only imported two of them.
As you can see, only those I've imported "can be seen as an Android Studio Project" as indicated that they have the Android Studio logo instead of a Folder.
This can be an issue for those just starting to develop in Android Studio on their own and they try and use existing projects (build from Eclipse or Android Studio) and they hit a snag with just trying to import the projects for reference. They might not know that they should import the folder and not the projectname/src subfolder. It adds to the "steep learning curve" that Android Development has if opening/importing projects aren't streamlined to a degree.
To sum up, my question is:
Why don't we have a single file that we can open that would in turn open Android Studio and import and build the project if it isn't built yet?
Android is not iOS. iOS development is only possible in xcode, hence it makes sense they added a shortcut to open it in xcode directly with a .xcodeproj file. Make life easier for iOS developers.
Android development however can be done outside of android studio as well. Eclipse is just one example, there may be other IDE's that support this. This is possible because android has standalone SDKs and tools that third party applications can use. iOS does not.
Imagine you are working on an android project in android studio. Then your boss tells you someone from 3000km away is going to help you. This guy may be using android studio, but maybe he isn't. When there are multiple options that developers can choose from individually, you do not want to pollute version control with files that you are using, but others may not care about. Each their environment.
This is merely a logical conclusion that you can come to by comparing. The "real" reason why this was done can only be answered by the people that created (adapted intellij) android studio.
This has been very frustrating to me too.
I try to give you a "beta" answer, waiting somebody to confirm it to me.
An Android project is just the composition of many parts that in some cases are concurrent to create the apk file.
It's just like what happens for the whole java projects: you have the main/src/java, the main/src/test, the maver or gradle files, the gradle or maven wrapper, the manifest, the configuration etc.
So you won't have a single project, but a series of folders that can contain many "flavours" or "versions" of the product itself.
The only help it is given to us is the Android studio icon that appears if a folder contains an android project in its subfolders.
I don't know if I have really answered to you, I just have given you my impressions and my thought.

Cordova: Trouble importing Android Downloader_Library into project

I'm using Android Studio and I'm close to just canceling the Android version of my app and just sticking with the released iOS version. I need to use an expansion APK and I cannot for the life of me get the downloader_library to import into Android Studio.
I try and run the project and it says it can't find anything from the expansion downloader. I've tried everything I can find on the forums. I've tried bringing into Eclipse and exporting out. I just can't get this to work.
I don't know if I have some kind of fundamental misunderstanding about Android and libraries and modules and things but I'm about ready to give up on this unless someone has an easy way to help me through. This is the very last step. I have the IAB working, the app works on multiple devices, the performance is good, I just can't figure out this splitting of the APK.

Unable to build android-support-v7

I've downloaded the Android SDK. I am trying to build the appcompat project. I've read that project is located here:
C:\Android\sdk\extras\android\support\v7\appcompat
I have imported the project into my workspace. It doesn't build.
I could go into great detail about which SDKs I have installed on my machine, etc. I could say that the values-v11, values-v14, and values-v21 folders all have errors, even though I have downloaded all three of these SDKs. But I am pretty sure if I import a project from the Android SDK website from the Android developer website, and I try to build that project, it should just work. I've followed the instructions here:
https://developer.android.com/tools/support-library/setup.html#libs-with-res
...and still not working.
So, why does this not work? I don't even care how to get it to work, I want to know why this does not work and why would I have to do any extra work or research to get it to build? Is this a problem with Eclipse? Should I be giving up on Eclipse and moving to Android Studio? This appears to be an incredibly simple thing to do and yet it does not work anymore.

Making changes to a built-in Android apps

I've pulled and compiled the latest Android tree. Now I want to make changes to the Android's Browser application.
The environment in Eclipse is already set up. I tried creating the project by selecting "Build project from existing source", but it fails to build because it uses libraries not in the SDK.
Does anyone know how to import the missing source in order to build the Browser app, or even better, how to just copy the source into a separate project and use it like I was developing a regular application?
Does anyone know how to import the missing source in order to build the Browser app
That is not possible. The "missing source" is the operating system.
how to just copy the source into a separate project and use it like I was developing a regular application?
That too is not possible.
You cannot just grab an app out of the Android open source project and build it via the SDK. Some of the apps were first written before the SDK existed. Other apps rely upon APIs that, for various reasons, have not yet been exposed in the SDK.
You are welcome to make modifications to the Browser app. However, to build them, you need to use the build process for the firmware, not treat it as a regular SDK-based project.

Categories

Resources