Developing Android application on multiple computers with Eclipse - java

I have my Android application project in Dropbox folder. I use my desktop pc as well as my laptop to develop the application. When I switch between these two computers, it uses some kind of different key or something for the application and Android SDK says I have to first uninstall (and lost all data) before I can install it again.
Any fixes?

While you should be using a Version Control System such as SVN, Git, TFS, CVS, etc. it sounds like you have an issue with the developer key used to sign the application. I haven't used Eclipse in over a year since I prefer using IntelliJ however I will answer from what I remember about Eclipse and the Android SDK.
The Android SDK has a default keystore that is used for signing development applications (on Windows it should be in C:\Users\username\.android\debug.keystore, on Mac it is /Users/username/.android/debug.keystore). If you want to be able to debug your application on multiple computers without uninstalling the APK first then you will need to copy one of these debug.keystore files to the other machine.
Now, as I mentioned I haven't used Eclipse in some time so Eclipse may use a different location/keystore combination (I know IntelliJ does) however the same method can be used.

Use subversion or git for your source control. Dropbox is not sufficient, since it won't even log history.
For subversion, I recommend google code with subversive eclipse plugin:
https://code.google.com
For git, you should use (with git eclipse plugin)
https://github.com/

Related

Can I develop Android apps without an IDE?

Is it possible to develop Android apps using only the Android SDK, without any IDE like Android Studio?
Yes, see the Google SDK documentation.
However, with the current toolchain and documentation it'll be an uphill struggle. I'm trying to do this too (for a dev who lives in Vim and Unix tools, Android Studio is needlessly slow and bloated).
The main issues I've found so far:
The SDK documentation gives instructions to create an Ant-driven project, but the SDK is now geared towards using Gradle. If you're working through the Google documentation in a linear fashion, you'll find subsequent lessons have you issue Gradle build instructions. For your Ant-built project.
There is very little documentation on how to actually create a Gradle-built project from the command line. The command line I use is:
android create project --target android-22 --name MyProjectName --path my_project/ --activity MyProject --package com.example.android.myproject --gradle --gradle-version 1.2.2
The --gradle-version actually refers to the Gradle Android plugin version, not the version of Gradle itself. Finding this out wasn't easy.
Even if you get it to create a project properly, it probably won't build without further manipulation. One of the generated files (project/build.gradle) has an invalid directive name (runProguard - I'm guessing it's now deprecated). That must be changed to minifyEnabled before the project will build. And using the Gradle plugin 1.2.2, the file project/gradle/wrapper/gradle-wrapper.properties has the Gradle distribution incorrectly listed as gradle-1.2.2-all.zip. This should be gradle-2.2.1-all.zip.
These are files generated by the SDK with errors.
The documentation is focussed on IDE-based development. Once you get past the initial few pages on creating and managing a project using the command line, it's very IDE-focussed.
Instructions on things like changing an app Theme are difficult or impossible to follow as they omit steps that the IDE performs for you.
In general, fully IDE-less development for Android (at least in Java, using the official SDK) is very painful. And my personal opinion is that IDE-based development is equally painful (slow, bloated, ugly on high-DPI screens under Linux and evidently full of magic that's a pain to replicate on the command line).
Edit: I should add that the above refers to using SDK tools v24.2, SDK Platform-tools v22, SDK Build-tools v22.01 and Android API 22 (5.1.1).
For android the basic debugging environments are:
ADB
DDMS
Java Debugger
You can try with them.
More details are here : http://developer.android.com/tools/debugging/debugging-projects-cmdline.html
Writing an Android app on Notepad is what I do on my Windows Laptop.
First you configure your laptop as follows:
Download development Kits: Download a Java Development Kit 1.6 for Windows and an Android Development Kit . Similarly try downloading older version of Android kit GUI version of Kit Manager so that you can download essentials. Using kit Manager download Android-23 platform build tools. Android Studio may have slower performance, so try to avoid it.
Configure Kits: Set Windows PATH variable by right clicking My Computer -> Properties -> Advanced System Settings or change the appropriate settings in your Control Panel. PATH should include the Java's compiler executable
file in Java directory, and the android.bat file of Android Kit.
Download Build-Tool: (recommended, but Ant can be used too.) These
programs configure the command-line tools for easy usage for our
convenience. I downloaded version 2.2.1 as it can use old
Java & old Android.
I've also written about these instructions on my GitHub Page.
For the development of Android apps one doesn't even need a PC, and not even the Android SDK. One can develop them completely on a mobile Android device, so an emulator isn't necessary either.
For that one needs to the app Termux on the device, and the toolchain script apkbuilder, which stitches together all APK building programs that come with the Termux packages aapt, apksigner, clang, cmake, d8, ecj and unzip, including the OpenJDK.

RegisterActivity: cannot be resolved to a type, AppEngine

I have set up my computer with windows 8.1 completely new (formatted), to be sure to have a working system.
I have installed Eclipse and the plugins the following way:
download and unpack eclipse Kepler
install JDK
install android SDK
install android SDK-plugins in eclipse
in android sdk: install all extras, API 19, in tools: Android SDK Tools, Android SDK-Platform Tools, Android SDK Build Tools (only newest, 19.0.3)
install all google plugins for kepler(Google App Engine Tools for Android, Google Plugin for eclipse, GWT Designer for GPE, SDKs)
Now, is everything set up correctly, to use google app engine correctly?
When I create a new app engine connected android project, google creates a bugged project.
I have 50 errors, of which 49 can be resolved by changing the Java version from 1.4 to 1.7 in the app engine project (Properties: Java Compiler and Project Facet)
However in the non-appengine project, in the MainActivity I get following error:
RegisterActivity cannot be resolved to a type.
How to solve this? I did not do anything by myself yet, I only created a project and I already have an error...
You are very thorough, which is good. Your development installation appears to have flaws, and you might be trying to make it run before you have seen it walk. You need to divide and conquer the potential problems. Initially simplify what you aim to create.
To pinpoint the errors, try the two standard tutorials before starting on your own design: first build and deploy an AppEngine project without Android components, and only after that works, build and deploy an Android to AppEngine project. Somewhere along that process your errors will show up, and then you should have a more specific piece of source code to show and discuss in this question.
Yesterday, a new version of Android SDK (22.6.2) was released. Apparently, the problem with RegisterActivity was solved in this update. Now I can create an Appengine connected Android Project without any errors!

Does Android SDK (Android Development Tools ) alter the Java SDK?

I want to develop a Windows application using Java SDK and eclipse, also I want to develop an Android app while using the same PC and eclipse. Is it possible to do both as I`m not sure if I set up eclipse and install the Android Development Tools (ADT) will I still be able to develop the Windows application at the same time???
No - all ADT does is use the existing JDK environment :)
You can just download the Android Development Tools from the Android website.
The Android Development Tools is nothing more than Eclipse modified with the ADT Plug in preinstalled.
In it, you have the option to create both Android projects and plain old Java projects.
So, downloading the Android Development Tools alone will give you everything you need.
If you already had Eclipse set up, installing the ADT yourself into it will not take away any functionality from Eclipse, it will just add ADT functionality on top of it.
No, it does not alter it.
You will have the Android SDKs on their own folders and has nothing to do with JDK.

Eclipse IDE for (Java and reports, PHP and Android)

There are different version of eclipse for different development environment.
My question is IF IDE remains same then why different versions, and if someone want to use all supported environments in single IDE how he/she can achieve that.
I want to use eclipse as single IDE for PHP, Java & Reports and Android development, instead of using different installation of eclipse.
Somebody helps me or refer me some link, it's quite confusing!
All the versions of Eclipse on the main site download page are the same version of Eclipse, but packaged with different sets of plugins. You can always install more features in Eclipse by installing more plugins.
You can have a single installation of Eclipse and use it for all your development needs - depending on your tastes however, it may sometimes be more manageable to have separate installations of Eclipse for different tasks (when there are a lot of plugins, Eclipse can take noticeably more time to start.)
There ARE different versions of Eclipse out there. But if we stick to one version and look at why there are different variants to download it's basically just that they come prepackaged with a specific component. So if you would like to use your Eclipse for C++ development you can get going with on single download. Instead of downloading the main IDE and then adding the module to support C++.
But after you install Eclipse, with any prepackaged modules, it's easy to add new ones. Say you have Zend Studio which is a PHP IDE based on Eclipse. You can still add all other modules supported by the version of Eclipse that Zend Studio is based on. For instance the Android SDK kit for Android development. You can add most modules by doing a search for them and finding the url to it's update site. Then click Help->Install New Software. Then you click Add and add the URL of the Update site of the module you wish to install.
Then you can select it from the Work with drop-down and it should appear in the list. Select it and click Next.
That way you can install almost all available modules for Eclipse. Note that sometimes you can run in to compatibility issues between installed modules and dependency problems. But most of the time it works fine.
They are not different versions, just the same backend with plugins for the particular language. Just that the specific versions are configured for best use with the language specified. If you want to use more languages than the default one in the eclipse you downloaded, just download the plugins you require and install in your installation of eclipse
Eclipse is plugin based IDE and these plugins may not like each other sometimes. It will be better to use more installations. In fact if you are developing Java and PHP you will need only 2 of them.
STS is a good Java toolkit especially if you work with spring.
If you new to Eclipse you should know that it can go crazy couple of times per month if you install too much and it is very annoying to see that one day your webapp is deploying and second day no...
Keeping installation separated you will have better control.

customized version of eclipse

I currently have the android sdk running with eclipse. It happens to be that I also want to download stanford's customized version of eclipse in order to learn some other stuff. Will there be a problem downloading and installing this customized version if I already another version of eclipse installed on my computer?
Nope! Just make sure you install them to different locations and (potentially) use different workspaces. Eclipse is totally self-contained in the eclipse directory (or where ever you install it).

Categories