Showing posts with label adt. Show all posts
Showing posts with label adt. Show all posts

Tuesday, June 17, 2014

Loading Google android API Samples to android studio


If you have tried loading the samples given by google using the sdk manager, you may have come upon a bit of a hickup.
NOTHING WORKS!
This is how to fix it:
Android Studio (Preview) version :  0.6.1
image
let’s import the media router sample project:
located at: C:\Program Files (x86)\Android\android-studio\sdk\samples\android-19\media\BasicMediaRouter
File->import
image
Select BasicMediaRouter, The Android studio will load, but empty:
image
Click on Project and open gradle.build file at root of folder:
image
Double click on the first error stating the build tools version is wrong and what is the correct build tools version:
image image
change the 0.9.+ to whichever is correct, mine is 0.11.+, the change attribute of file from read only to writable dialog will appear, click ok to continue to edit the build tool version the red squiggly line will disappear  meaning you are on your way !
Build->Make Project
image
a new error message comes up in the gradle build tool window: Task ‘assemble’ not found in root project ‘BasicMediaRouter’
What this means is something to do with IDEA changing versions and changing shit with no backward compatibility (thanks guys)
basically easy fix: open up the *.iml file in the root locate the component named FacetManager and delete the entire component
image ==> image
as you click save, the IDE might wish to reload and the IDE will (Finally) get that this is an android application and ask you to configure it:
image
if it doesn’t work go to File->Project Structure
don’t ask me why, but your project is no longer configured for an SDK
image
select an installed SDK in the dropdown menu and click OK
the error: Error:The SDK Build Tools revision (19.0.1) is too low for project ':BasicMediaRouterSample'. Minimum required is 19.1.0 will still be there. Open the build.gradle file that is not in the root directory and change the 19.0.1 to 19.1.0
image
Click on SYNC GRADLE WITH PROJECT FILES image
this is the last thing that will appear, I am unsure what it is but it does no harm either way.

now setup the build properties and click the Ctrl+F5 to load.

Oh and good luck with the rest

Thursday, December 08, 2011

Android Source Files

 

for some reason, the open-source project Google setup for android with all the Git’s and Repos and stuff is very well mainained but requires a degree in particle physics to understand.

This is especially true, if you’re just trying to look under the hood of android and not interested in joining the project per-say or  uploading stuff of your own to a Git repository.

I come from Windows and am unused to becoming an IT specialist to install and use development software.

looking around different blogs and sites I finally found a likeminded individual interested in spreading the joy of SIMPLE and EASY rather than COMPLEX and REQUIRES HOURS OF UNDERSTANDING to do android things.

I want to develop for android, not be part of a complex Operating System’s development team (at least not for now).

I found a blogger who has likeminded views on the subject.

http://mobilebytes.wordpress.com/2010/06/30/classes-source-for-eclipse/

He has downloaded, stripped, mapped, vm’s and refitted the sources for android classes ready for Eclipse.

I uploaded them to megaupoad as well to lower this bloggers bandwidth problems (in case he pays for them)

and here they are:

Android version source megaupload URL I uploaded it to
1.5 r3 http://www.megaupload.com/?d=OL71VL2F
1.6 r2 http://www.megaupload.com/?d=B5F0R1AV
2.01 r1 http://www.megaupload.com/?d=MIJOHYYI
2.1 r1 http://www.megaupload.com/?d=93048HL0
2.2 froyo http://www.megaupload.com/?d=UJRSNLHN

 

In case you don’t know how to wire this up:

Step 1

Download the source codes into a directory such as c:\android\android-sdk-source\

SNAGHTML498a857

Step 2

1) open eclipse, open a project you wish to view the source of:

 

Right click on android.jar – select image

2) Select properties (last one on the context menu) or press Alt-Enter

3) In the window that comes up, under Java source Attachment select External file, then find the source file you downloaded in my case C:/Android/android-sdk-sources/android-sdk-1.6_r2-src.jar

image

4) click Open on the Windows Folder

5) and OK on the eclipse, and you should be all sourced up.

usage:

Click F3 on an android class such as BroadcastReceiver.class and you will see the source code.

image

Word of warning to the Debuggers out there.

YOUR USE OF ANDROID SOURCES and Versionage does not mean the EMULATOR is using the same version - if your app is for android 1.6 (as most should be) and your emulator is 2.2, the source you should attach is 2.2 as the emulator works under 2.2 and not 1.6

make sense?

Good luck

Mickey Perlstein