Tuesday 17 March 2015

HOW TO implement the SmoothProgressBar example


SmoothProgressBar HOW TO notes

IMPLEMENTATION OF THE CASTORFLEX-SMOOTHPROGRESSBAR EXAMPLE of Chris Banes

1- Download the zip file from https://github.com/castorflex/SmoothProgressBar
2- Create a new workspace with Eclipse.
3- Copy the zip file into the workspace and unzip.
4- Import the android as below.
5- There are two main project names with the name ‘Main’.  If you try you will
get error message saying that there is already a project names  ‘Main’.  The
solution is:  We will first open only two not three projecst and then add the
 resources and source files of the third manually.

6- With two projects, it gives the below error message.  The mainactivity can not
find some resources related to the circular progress bar includes.


7- Add manually the resources of the circular progres bar and clean the project. 
The styles mistake got corrected. 


 8- But still continues the R not found error. 
Import uk.co.senab.smoothprogresbar.library.R;  so that the JAVA programs that
use the resources we have added can see them.


9- The program compiles but does not work when deployed.  Because I forgot
to move the JAVA lib contents to the src lib at the MainActivity project that
uses the smoothprogresbar lib.


10- It repeated the resource error again.  It could not see general resources: R.dimen, R.color, R.integer.   I had added the
C:\Users\ars\android-sdks\extras\android\support\v7\appcompat\libs?
android-support-v4
android-support-v7-appcompat
This may help in some cases but the solution to the current one was:
xmlns:android=http://schemas.android.com/apk/res/android
I added this to the top of AndroidManifest.xml file.  All the general res items are
Accessed through this.

11- Resource errors are cleaned but:  Minimum version errors appear.
Change  AndroidManifest.xml file  and add
<uses-sdk android:minSdkVersion="14"  android:targetSdkVersion="21"/>

Installation of the android develepoment environment

Installation of the android develepoment environment


First, I tried to use Eclipse and after some problems I used Android Studio.  Android Studio is the official development environment from Google.  It is based on IntelliJ IDE, which is unfortunately too big and clumsy.  The problems I had with Eclipse got fixed once the Android Studio was installed.

1- Download  eclipse-jee-indigo-SR2-win32-x86_64 .  Android Kt does not work with every family of Eclipse.  You must download the latest version of Indigo family.


2- Shortcut to run Eclipse
Start in: "C:\Program Files\eclipse-jee-indigo-SR2-win32-x86_64\eclipse"
Target: "C:\Program Files\eclipse-jee-indigo-SR2-win32-x86_64\eclipse\eclipse.exe" -vmargs -Xmx900M

3- Unzip the Eclipse download file and copy it in the target directory.

4- Installing the Eclipse plugin:
http://developer.android.com/sdk/index.html
Download Android Studio and SDK Tools | Android ...
developer.android.com/sdk/

Download the official Android IDE and developer tools to build apps for Android phones, tablets, wearables, TVs, and more.

Installing the Android SDK
https://developer.android.com/sdk/installing.html

Android Studio provides everything you need to ... Migrating to Android Studio
https://developer.android.com/sdk/installing/migrate.html

To migrate existing Android projects, simply ... Migrating to ...

Adding SDK Packages
To start adding packages, launch the Android SDK Manager in ...


Android Studio Overview
Android Studio is the official IDE for Android application ...

Installing the Eclipse Plugin
Installing the Eclipse Plugin. Android offers a custom plugin ... Android NDK
Before installing the Android NDK, you must agree to the ...

ADT Plugin
Android Development Tools (ADT) is a plugin for the Eclipse IDE ...


SDK Manager
On Windows, double-click the SDK Manager.exe file at the root of ...

SDK Tools
Known Issues - ADT Plugin - SDK Platforms - ... Managing Projects


Android Studio provides graphical tools for creating and managing ...
android.com alanından daha fazla sonuç

5- The items, SDK tools, SDK Manager, ADT Plugin can also be loaded from the Android Studio.


 The important point is,
Whether Eclipse or Android Studio they always create and write to the same place. 
C:\Users\ars\android-sdks
They both use the same tools.

6- I began to use the Eclipse+ANDROID plugin
http://iit.qau.edu.pk/books/Android.Application.Development.for.For.Dummies.pdf
Chapter 2: Preparing Your Development Headquarters . . . . . . . . . . . . .25


7- After I installed Eclipse + the Android Studio’s Eclipse Plugin, I could not use x86 device emulators because it said it needs HAXB accelarator.  I could only use non-x86 emulators which are provided by Google.
 
8- At this point I decided to install Android Studio.  I did so with no major problem.


9- I tried to run a simple example, it showed me the previous device emulators that I had created with Eclipse plugin.  It did not work with them.  I had to reload these emulators.  I reloaded almost everything in the SDK manager.  This included the HAXB accelerator.  The difficulty with x86 emulators is solved by this.  Now, I could use all the device emulators.


10- When I returned back and tested the same application I saw that the problems of the Eclipse plugin were also solved.  I can also use the Eclipse plugin now but it is reasonable to continue with the Android studio as it is now the official Google IDE.

How to decode an android application-APK file and reengineer


How to decode an android application to JAVA


1- http://stackoverflow.com/questions/1249973/decompiling-dex-into-java-sourcecode

Get these tools:
1) dex2jar, which is made by a Chinese student. It will translate dex files to jar files
2) jd-gui to view the java files in the jar

The source code is quite readable as dex2jar makes some optimizations.

Procedure:
And here's the procedure on how to decompile:

Step 1:
Convert classes.dex in test_apk-debug.apk to test_apk-debug_dex2jar.jar
d2j-dex2jar.sh -f -o output_jar.jar apk_to_decompile.apk
Note: In the Windows machines all the .sh scripts are replaced by .bat scripts
dex2jar documentation

Step 2:
Open the jar in JD-GUI


How to decode res (resource files)

C:\Users\ars\Desktop\APKtool\prebuilt\aapt\windows>aapt c -S .\res -C .\out 2>error.txt

Crunching PNG Files in source dir: .\res
To destination dir: .\out


C:\Users\ars\Desktop\APKtool\prebuilt\aapt\windows>aapt
Android Asset Packaging Tool
Usage:
 aapt l[ist] [-v] [-a] file.{zip,jar,apk}
   List contents of Zip-compatible archive.
...

C:\Users\ars\Desktop\APKtool\prebuilt\aapt\windows>aapt c -S .\res\layout -C .\out

Crunching PNG Files in source dir: .\res\layout
To destination dir: .\out


C:\Users\ars\Desktop\APKtool\prebuilt\aapt\windows>

HOW TO connect REEDER7iC to Android studio

Connecting REEDER7iC to Android studio


1- I connected the cable.  I did start->computer->right click->manage->device manager
->others
(using Windows7).

Others displayed a yellow ! sign next to ‘MTP’.

I could not see the portable device in the start->computer-> screen.

2- I found and downloaded the reederA7iC driver.
IntelAndroidDrvSetup1.1.5.exe

After I installed start->computer-> portable devices reederA7ic appeared.


3- The computer can see the reeder as portable device but Android Studio could not see it.

I did start->computer->right click->manage->device manager->others

Still displayed yellow ! mark next to ‘MTP’
But it also displayed the portable device->reederA7iC


4- C:\Users\ars\android-sdks\platform-tools>adb kill-server

C:\Users\ars\android-sdks\platform-tools>adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *


5- C:\Users\ars\android-sdks\platform-tools>adb devices
List of devices attached


It still did not list the reederA7iC device.


6- Android studio->tools->SDK manager->Google USB driver  install...
x64 os
CertMgr.exe MFLD_USB_driver_cert.cer returned 0
Installing drivers, please wait
drvinstall.exe gadget_multi.inf returned 0
drvinstall.exe gserial.inf returned 0
drvinstall.exe rndis.inf returned 0
drvinstall.exe intelmtp.inf returned 0
drvinstall.exe android_winusb.inf returned 0

7- It still did not list the reederA7iC device and device did not appear at
Android Studio->Android window at the bottom or ADB(Android Device Bridge)
adb devices     command.

8- http://stackoverflow.com/questions/17509422/android-device-is-not-connected-to-usb-for-debugging-android-studio

This solution works for every unregonized android device... mostly general brands don´t come with usb debugging drivers...

• go to settings
• control panel
• hardware and sound
• device manager
• And look for any devices showing an error. Many androids will show as an unknown USB device or just Android

First thing you need will be your device IDs. You can get them opening up the device manager and finding the "Unknown Device" with a yellow exclamation point. Right click on it and select 'Properties', and then go to the 'Details' tab. Under the 'Property' drop down menu, select hardware IDs. There should be two strings:

USB\VID_2207&PID_0011&REV_0222&MI_01
USB\VID_2207&PID_0011&MI_01

Copy those strings somewhere and then navigate to where you downloaded the Google USB driver. Then you need to open up the file 'android_winusb.inf' in a text editor. I would recommend using Notepad++.

Not this one->C:\Windows\System32\DriverStore\FileRepository\ winusb.inf_amd64_neutral_6cb50ae9f480775b

Not this one->C:\Windows\System32
\DriverStore\FileRepository\android_winusb.inf_amd64_neutral_ad188d208ea0ea22

C:\Users\ars\android-sdks\extras\google\usb_driver
First, create a sub-section for your device. I called mine ';RCA 6378W2' but it doesn't really matter what you call it. Then, under the sub-section you created paste the Device ID strings you copied from the Device Manager, preceded by '%SingleAdbInterface%'. If you need help, look at this screenshot

NOTE: If you are using Windows 8 or 8.1, you will need to disable device driver signature checks before you'll be able to install the modified driver. Here's a quick video on how to disable device driver checks http://www.youtube.com/watch?v=NM1MN8QZhnk. Ignore the part at the beginning about 64 bit, your computer architecture doesn't matter


9- C:\Users\ars\android-sdks\extras\google\usb_driver\
android_winusb setup information file -> android_winusb.INF

10- Start->Computer->right click-> manage->Device manager->others->MTP->right click ->properties->details(dropdownlistbox)->hardwareIDs  

11- ;MTP (ARS)

%SingleAdbInterface% = USB_Install, USB\VID_8087&PID_0A16&REV_????&MI_01
%SingleAdbInterface% = USB_Install, USB\VID_8087&PID_0A16&MI_01

12- After this I reloaded the reederA7iC driver again.

13- Device manager displayed Android Device at the top and Android aDB Interface underneath it.  Others->MTP disappeared.

14- Android Studio began to work with the reeder device.

15- When the reeder device is not connected device manager does not display the related items on its list.


Please contact arsaral (at) yahoo.com if you need help.