I have tried, sporatically and ineffectively, to use Eclipse as an IDE for my
Android Development. Now I am switching to Android Studio.
They(Google) have completed a lot more -and- they have
incorporated the use of the NDK... which was missing... well, according to what I just read on the Web, it
technically still is. But, so far, there have been no complaints.
(March 22nd, 2015)
At least not from the code I have been working with so far.
In fact, some of this, NO, most of this was/is copied from the Web. The 'main changes' I have made are ... making all this,
more or less,
HTC
ReZound
specific.
March 25th, 2015 / 1:30pm Ok, I'm bad, I'm bad... Started writing this up -AND-
I already have most of it installed. So, when I go to the references, they point out some of the steps that I have already
performed. IF some of my steps look out of place... that's cause they probably are. Like I have said a gazillion times... these
WebPages are for meself more than anything. IF you can benefit from them ... then GREAT!!
Some Install Steps
Cyanogen on our System
In order to work with the code, we need to install it
on "our system". This is accomplished via the following commands:
$ md ~/Android
$ cd ~/Android
$ md cm11.0-rezound
$ cd cm11.0-rezound
The following is an exact copy of the script that I use to get my intial setup. NO, I did not write it. I wasn't
that smart, in the beginning. One of my "Team Mates" wrote it.
#/bin/bash
#
# Notes have been added by me cause... I don't remember things well anymore.
# -And- as it turned out... helped with this writeup.
# Is there a .repo dir?? IF not create one.
# Then put it on top of the stack. ie; cd into it.
#
[ -d .repo ] || mkdir .repo
pushd .repo
# Is there a local_manifests dir in .repo?? IF not create one.
# Then put it on top of the stack. ie; cd into it
#
[ -d local_manifests ] || mkdir local_manifests
pushd local_manifests
# If there is a local_manifest.xml, remove it.
# Get the latest one from github.. rename it and cd back to the root
# with the 'popd' commands.
#
rm -f local_manifest.xml
wget https://raw.github.com/vigor/android/cm-11.0/local_manifests/local_manifest_hybrid.xml
mv local_manifest_hybrid.xml local_manifest.xml
popd
popd
# To initialize your local repository using the CyanogenMod tree
# -u: specify a URL from which to retrieve a manifest repository.
# -b: specify a revision, i.e., a particular manifest-branch.
#
repo init -u https://github.com/CyanogenMod/android.git -b cm-11.0
# Theoretically a stable version versus the "Bleeding Edge" version.
# repo init -u https://github.com/CyanogenMod/android.git -b stable/cm-11.0
# Now cd into .repo. Edit manifest file. Remove sync-c="true"
#
pushd .repo
sed -i "s/sync-c=\"true\"//g" manifest.xml
popd
# Now get the code tree...
repo sync -j8
# Get the vendor specific stuff...
pushd vendor/cm
./get-prebuilts
popd
"repo help manifest" is the command to get more info on the manifest file.
And of course there is documentation in: ".repo/repo/docs/manifest-format.txt"
Thanks to
StackOverflow
Now, as root, we check our 32-bit libs:
( ia32-libs in openSuSE 13.2 )
Tipper-i7:/home/ctaylor/Android
# zypper install -t pattern 32bit
Loading repository data...
Reading installed packages...
'pattern:32bit' is already installed.
No update candidate for '32bit-20141007-5.1.x86_64'. The highest available version is already installed.
Resolving package dependencies...
Nothing to do.
June 17th, 2016/9:16pm Ok... on the newest machine we got the same results.
Android Studio Install Android Studio, is an IntelliJ IDEA-based Android development environment.
Download from Here
either to the dir you are going to put it in -or- a temporary one. The extraction process will let you pick where you want it. I bring things
down to my Download dir and then do the extraction to the real place.
Now then, I am not only being specific to the ReZ but also to openSuSE 13.2.
Using Dolphin, go to the Download dir and click on android-studio-ide-135.1740770-linux.zip -or- whatever
version you got. It will expand and show its contents. Along the top are some commands. One of them is 'Extract'. Click on it and you will
be presented with your directory structure. Default is where you are. IF you want to place it somewhere else, move to it by clicking on
the dirs presented. UNLESS you change it, it will create a default "android-studio" dir where ever you click. I chose my
'home' dir. When you are finished execute these commands --- making changes where appropriate. The dirs.
$ cd ~/android-studio/bin
$ ./studio.sh
On the first execution of this command, it will finish the install and setup. Thereafter, it will startup the Studio.
Resolve SDK not included in Studio
End Install Steps
Is Android Studio a fork of IntelliJ IDEA?
No. Android Studio and the Android plugin for IntelliJ IDEA are built from the same code, and all of the changes in
Android Studio are, and will continue to be, available in IntelliJ IDEA releases.
IntelliJ IDEA and Android Studio FAQ
Development Information
Android Studio for Beginners: Part 1
Part 2
Part 3
Setting up Intellij with CyanogenMod/AOSP development
Develop AOSP on Android Studio: Part 1
Part 2
Part 3
Tips of the Day <- On GitHub
Theme Manager
Simple Theme Guide
* * * NDK support deprecated for Android Studio 1.1.0 * * *
Android Studio Overview
Using Eclipse
Does Android Studio have a Heirarchy Viewer?
DDMS, Hierarchy Viewer, openGL Tracer etc all moved into Android Device Monitor. To access:
- In Android Studio(the app) on menu Bar Select: Tools > Android > Android Device Monitor
- In ADM: Window > Perspective
- Click on Hierarchy Viewer.
From:
StackOverflow
and
Developer Phil
Setting Up for CyanogenMod Development
Before starting, I'm sure that you must understand that the computer/PC you are going to use should be fairly powerful -and-
have a substantial amount of RAM and HDD space available... the more the merrier.
You first need to make sure that your IDE has lots of RAM allocated to it.
Change ../android-studio/bin/studio.vmoptions & ../android-studio/bin/studio64.vmoptions
From:
-Xms128m
-Xmx750m
To:
-Xms512m
-Xmx2048m
Those values are in BOTH files.
Next, you need to open up idea.properties and change idea.max.intellisense.filesize to something like '5000' or more.
If we don't do this IntelliJ won't parse some R.java files generated.
Note: these files are located in the ~/android-studio/bin/
Now we go to our android root directory. The android root directory is
~/Android/cm11.0-rezound
.
$ cd ~/Android/cm11.0-rezound
Need to execute "build/envsetup.sh". After it is setup execute 'hmm' from the command line to see what it did
and what you have available. Since we are working on the
ReZound
it might be to our advantage to also execute: "lunch cm_vigor-userdebug" So the source knows which
device to attempt building a boot for. Not totally sure that last item is needed for this part -but- it is needed if/when
you build a "BootImage".
From the the Android root dir:
$ . build/envsetup.sh
$ lunch cm_vigor-userdebug
ctaylor@Tipper-i7:~/Android/cm11.0-rezound
> . build/envsetup.sh
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/goldfish/vendorsetup.sh
including device/generic/mips/vendorsetup.sh
including device/generic/x86/vendorsetup.sh
including device/htc/vigor/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/cm/bash_completion/git.bash
including vendor/cm/bash_completion/repo.bash
ctaylor@Tipper-i7:~/Android/cm11.0-rezound
>
ctaylor@Tipper-i7:~/Android/cm11.0-rezound
> lunch cm_vigor-userdebug
Trying dependencies-only mode on a non-existing device tree?
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.4
CM_VERSION=11-20150601-UNOFFICIAL-vigor
TARGET_PRODUCT=cm_vigor
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=scorpion
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.7-35-desktop-x86_64-with-SuSE-13.2-x86_64
HOST_BUILD_TYPE=release
BUILD_ID=KTU84Q
OUT_DIR=/home/ctaylor/Android/cm11.0-rezound/out
============================================
Now Compile the idegen tools:
$ cd development/tools/idegen
$ mm
Well... all did not go well:
warning: [options] bootstrap class path not set in conjunction with -source 1.5
Now we have to find out what that means!!
Well, we did: (click on error message above for full description)
This warning is emitted if you are using JDK 7 Build 121 or later (earlier versions of the compiler would not
issue a warning).
It is warning you that your Java compiler version and the version of Java you are compiling for are different.
For example, you may have version 7 of the compiler installed, but are choosing to compile for Java version 5.0.
While the compiler is capable of emitting code for different versions, it needs to use the correct startup
libraries (bootstrap) in order to guarantee it will function correctly.
Well, it is only a Warning and it is because we have 'old' code in here -and- I'm not gona re-write the whole thing.
It happens to be mostly in Java. In fact everything except the kernel is in Java. So, we will just continue for now.
Your Java version: Version 7 Update 71
Go back to the root directory and run the tool:
$ cd ~/Android/cm11.0-rezound
$ development/tools/idegen/idegen.sh
Read excludes: 44ms
Traversed tree: 101073ms
Looks like it just read the whole 'Cyanogen Tree'.
April 16th, 2015 / 5:31pm Files created by the above:
android.iml
android.ipr
android.iws
April 29th, 2015 Received my copy of
"Android Studio Development Essentials" that I had ordered. I got both the
printed and e-book PDF forms.
June 18th, 2016/5:52pm
Well, we have gotten this far with the Newest HP i7-2
Machine. Have installed and fired up the Studio .
May 11th, 2015 / 3:54am I have been interrupted on this so many times it isn't
even funny. Interruptions have been for tons of reasons and my latest is,
Dakotah. He is my new Husky/Shepherd puppy and
I had forgotten how much time and attention a new puppy requires. We are going to get the carpets thoroughly cleaned -OR-
maybe even replaced AFTER he is house broken. Those "Training Pads" only half work. -BUT- in their defense they
do help. Annndd... not to put all the blame on the new puppy, I also got a part time job at
McDonalds. Which has been
more hours than I expected. There are others -but- those are the two main ones.
I had this all setup and then destroyed it and I don't remember why NOR do I remeber what I did to
get it to work. Reason for book purchase. I have my CM11
as the only project, at this time, but when I click on it I get a message
about missing files. The ones listed above (April 16th)
were the first ones listed and now after executing the idegen they are not complained about
any more. New complaint;
"Cannot load /home/ctaylor/Android/cm11.0-rezound/.idea. The file does not exist."
annnddd... I have no 'idea' how it gets created!! Guess I'll read my new book!! Well, that was a disappointment. Nothing in the book on
this file!!
However, I did find an answer on the Net. I had to RE-import my project.
Could not open project
-BUT- (that word again)
the folders were not listed like they were the last time. I stumbled through this the first time and got something that looked
useable. Now following all the directions... it doesn't!! So... we will start again.
Remove a Project
First close the project, then move the mouse cursor over the hi-lighted project and press the keyboard DEL key.
Viola, it is gone. May 31st Starting again and it looks like
the project is still gone, so I guess I removed it.
June 18th, 2016/6:02pm
Starting again... almost. I copied over the dir/project from the previous HP i7-1.
It works and I got a successful compile. Just need to get all the stuff for this Studio set up on the New HP i7-2
May 16th, 2015 / 5:05am | May 31st First thing we are gona do is ruin the whole mess.
Updates!!! It is claiming multiple times that there are some updates.
OK. I let it do the updates and it removed a PDF that I had in the dir plus a .directory file. It is only allowing what
it wants to allow. Then AFTER the UpDate was finished it claimed there were more UpDates!! So, what the heck, we did
these UpDates too!
May 31st , checking UpDates again. It replied that I have
the latest Android Studio installed.
Allllrighty now... we got a clean Welcome window.
May 31st Had problems getting the Android Studio png icon to show up on my Desktop
when I linked the app to it. Had to finally use the ico icon.
Import Eclipse Like we did in our first stumblings, we are trying to import our
Eclipse project. It said that the .idea project already existed and asked IF we wanted to replace it. We said yes. It 'fastly'
went through all the dirs... then it listed them. We clicked on Next and it said: 6:34am Searching for libraries. 2-3min Please wait.
then it changed to: 6:36am Searching for modules. Please wait. Took a long time but finally finished. Got a couple more
screens -but- I forgot to write them down here and now I forgot what they were. One of them listed all my dirs and files.
I clicked on OK -or- Next to accept them.
June 18th, 2016/6:13pm
Did NOT import Eclipse this time. I imported the one from the previous machine. Which was imported from Eclipse so,
I guess round aboutly I did it again.
6:15:40 PM Migrate Project to Gradle?
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
More Information about migrating to Gradle
Don't show this message again.
6:15:47 PM Unregistered VCS roots detected
The following directories are roots of VCS repositories, but they are not registered in the Settings:
/home/ctaylor/Android/cm11.0-rezound/prebuilts/misc
/home/ctaylor/Android/cm11.0-rezound/prebuilts/eclipse
/home/ctaylor/Android/cm11.0-rezound/prebuilts/sdk
--- --- --- more files ---
/home/ctaylor/Android/cm11.0-rezound/vendor/cyngn
/home/ctaylor/An... (show balloon)
6:18:02 PM Frameworks detected: Android framework is detected in the project Configure
The above is what we ended up with here initially. Gona check out that Gradle first. And I did.
Gradle is recommended over IntelliJ cause that is what Google is focusing on and they want you to use. So we will "Migrate"
over to Gradle.
May 31st, 2015 I re-tried Eclipse and was as unsuccessful this time as before. So, once
again we are trying Android Studio. Gona see IF I can stumble into a working environment like the last time.
June 2nd, 2015 / 6:44am Inconsistent!! My time for this keeps getting interrupted!! In
my most recent setup I have "cleaned" up my environment... I hope... and have the proper paths to the proper items. At one
place/time they say the SDK is NOT included with Android Studio and then in others they say it is. Well, in my most recent installation,
it was/is included. So, I had to fix the PATH so that it would NOT use the 'old' one that I had setup for Eclipse!! Upset??? Yes!!
It just shouldn't be this hard!!
June 2nd, 2015 / 8:47am Allllllrighty Now...Got it to work!! What??
Android Studio!! Now then, I tried to get everything straight before trying to "Load Up CM11". Then I had to decide on
the "Load Up" type. My last "successful" Load Up was a crazy mixed up import of an Eclipse version. Upon
looking around I decided to use the one suggested by Cyanogen themselves:
import to intellij
The following is a copy of theirs "modified" to meet our needs.
- This part you should have done above. It will create the android.ipr file plus 2 others.
croot
make idegen && development/tools/idegen/idegen.sh
- Open Intellij Android Studio
- Click
Open an existing Project
- Navigate to
~/android/system
- Choose android.ipr
Finish
June 23rd, 2015 / 8:37pm I decided to test my Android Studio
with the test app in my copy of "Android Studio Development Essentials". I had started this once before -but- got
interrupted -and- things did not go like the book.
- Open Android Studio. The Welcome Screen is ok and the same as book.
- Because I had started this once before, parts of it are still there. So it may not mess up like it did the first
time... which is what I was trying to document WITHOUT destroying all that I have installed. Just believe, that
IF you have a brand new install it will be different.
- The Phone and Tablet option is selected. As stated in the book, we will not be dealing with TV or Wearables,so
leave them blan or un-checked.
- We are going to create a Blank Activity.
- Customize the Activity: Name it "AndroidSampleActivity".
- After clicking on "Finish" it creates the project.
Ah, with "Rendering Problems". Must 'UpDate' Android Studio.
And, naturally, AFTER the UpDate we have "Rendering failed with a known bug.
Please try a rebuild." We did annndddd....
Allllllrighty now!!! We have created a minimal example project -AND- I see
a Cell Phone image in the Main Project tool window!!! This is the best I have had with anything.
And naturally my dog is up and needs attention and then I
will have to get ready and go to work. -BUT- we have something!!! June 24, 2015 / 3:54am
- Now we want to modify the User Interface which is contained in:
app->res->layout->activity_android_sample.xml
Which as it turns out was what was showing on my screen anyway. A Nexus 4.
No ReZounds in the selections.
- Cool... you can switch between Portait and Landscape mode views.
- In this 'Layout' they have the usual 'Hello World'. We are going to change that to larger text
and some different wording: 'Welcome to Android Studio'.
- Well now, not mentioned in the book. After changing the text and creating the 'new resource' we got
an error message about Rendering. Unfortunately, we got it corrected before writing down exactly what
the message said. -But- the point is... we got an error. We believe that the error was nothing more than
a 'Timming Error'. It was complaing about the 'new message'. A refresh of the screen cleared the error.
Prior to the Refresh we had examined the code and stuff ... and the book. Found nothing and just did
a Refresh ... because. It cleared the error and showed the Nexus 4 image with the new message. Success!!
- Managing/Creating AVD's
This is in here ... because. Really I would like to create one for the ReZ
-but- that will probably be later.
- July 10, 2015/4:03am - Need the Gradle. We have Migrating from Eclipse and Migrating from IntelliJ -to-
Android Studio. The second one is a little strange cause... Android Studio
is built from, -or- on, IntelliJ. Now I keep getting this message that my project is NOT a Gradle-based project... do I want to migrate?
Well, yes I do -but- all the info is based on 'apps' NOT the 'platform'. Finding this info is a bitch!! Either I just am not using
the correct words in my search -or- I am to stupid -or- both.
The following 'build.gradle' file is a copy of the example at:
Migrating from IntelliJ
-and- modified by me to fit my needs... eventually. Need to figure out/learn what all this means.
See below this...
// =====================================================================================
// build.gradle - Copied/Created july 8th, 2015 - 7:53am
// =====================================================================================
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src//... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
- Continuing on in the Gradle: As mentioned, the above build.gradle file was/is and example
from the IntelliJ Migrating docs. Now then, the versions ... the versions ... need to have a proper relationship with each other. What??
Well, I found this fact when searching for information on the build.gradle file(s) to be used in CyanogenMod. The gradle version -and-
the gradle build tool version MUST have a proper relationship. This is described more at:
StackOverFlow
which is where I first found it. I blindly changed the classpath in the above build.gradle file to make it UpToDate. Then
found this.
- Again from StackOverFlow
File->Project Structure->Project pane->"Android plugin version".
Make sure you don't confuse the Gradle version with the Android plugin version. The former is the build system itself, the latter
is the plugin to the build system that knows how to build Android projects.
Manufacturer |
Model |
Diagonal |
Generalized size |
Density bucket |
Width (px) |
Height (px) |
Density |
Bucket dpi |
Width (dp) |
Height (db) |
HTC |
Rezound |
4.3 |
normal |
xhdpi |
720 |
1280 |
341.54 |
320 |
360 |
640 |
GitHub
July 7th, 2015/3:57pm My how time flies.... Allllrighty now we have the
Studio installed -AND- working -and- we have loaded up our
CM11.
This little section will contain references to WebPages, on which, I have found some kind of interesting
information -and- I don't want to loose it. Many times I find something else when I'm searching for something else.
android-studio-vs-eclipse
Exporting from Eclipse to Android Studio
Google Launches Android Studio
IntelliJ IDEA and Android Studio FAQ
JetBrains IntelliJ IDEA Blog
* Android Tools project site *
Boot Animations Change
Android CyanogenMod Diffs
Comments...
Setting up Intellij with CyanogenMod/AOSP development