[Automation Tool] [Java] [WIP] [Tutorials] Selenium [RHBROMS] - Android General

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
SELENIUM by Ravi H Basawa​
This will be a Full Tutorial on Selenium Automation Tool
I will be updating this thread as I get time. SO NO ETA's.
Click to expand...
Click to collapse
If anybody wants to use / copy this tutorial to their Website or Blog please feel free to contact me at my personal email id: [email protected]
or at our official Website: www.rhbroms.com
Click to expand...
Click to collapse
Please Click on Thanks button if this tutorial by me had helped you for some extent !!!
Click to expand...
Click to collapse
Contents:
1. What is Selenium?
2. What all we need before we get it started?
3. How to setup Selenium for Eclipse?
4. Simple Selenium Test Script for google.co.in
5. Execution using Junit
5a. Execution using TestNG
6. DataDriven Testing using POI jar files
7. Issues or challenges with Selenium
Credits:
@Swaroop Bandagadde
My Other Works:
1. ROBOTIUM AUTOMATION TOOL
2. MONKEYRUNNER AUTOMATION TOOL

Selenium
1. What is Selenium?​
Selenium is an open source ( It's free !!!!) automation testing tool used for automating websites under any browser(not all).
Selenium supports the following browsers: IE, FireFox(Default), Chrome, Safari, Opera.
We write Selenium WebDriver Scripts in Eclipse. These scripts are written in Java language.
Things that you should be good at Java are: Constructors, Overriding, Overloading, Constructor Chaining, Interface, Inheritance, Abstract Class and UpCasting - DownCasting concepts are enough to write Selenium WebDriver Script.

What all we need before we get it started?
2. What all we need before we get it started?​
1. Windows 7 / 8
2. Java
3. Eclipse ((Juno or ADT) what I have worked on !! )
4. selenium-server-standalone-2.38.0
5. TestNG plugin for Eclipse
6. POI jar files
Downloads:
POI jar files: POI.zip
Selenium Jar file

How to setup Selenium for Eclipse?
3. How to setup Selenium for Eclipse?​
1. Open Eclipse goto Help -> Install new software.. -> give work with edittext field value as " TestNG - http://beust.com/eclipse " -> select all -> Next -> Finish
2. when you create a new test project inside its build path add selenium webdriver jar files. I will show it in next chapter.

4. Simple Selenium Test Script for Google website
4. Simple Selenium Test Script for Google website ​
1. Create new java project with name Selenium Test as shown below:
2. Now we have to add the selenium Jar file to the build path ( Goto project -> Properties -> Java Build path ) as shown in below screen shot and add the downloaded selenium-server-standalone-2.38.0.jar file. by clicking on the add external Jar's button. After this goto "Order and Export" tab click on "Select All" button and click "ok" button.
3.After completion of the above step now create a new java class ( Goto Project -> New -> Class) as shown in below ss and give name as TestWebDriver
4. After this now we will write a code to open Mozilla FireFox Browser and also open Google website inside it. The code for this is as below:
package com.rhb.selenium; // package name what I have given. It can differ with yours
import org.openqa.selenium.WebDriver; // Automatically imported by eclipse [This is for invoking the WebDriver class from selenium API]
import org.openqa.selenium.firefox.FirefoxDriver; // Automatically imported by eclipse [This is for invoking the FireFoxDriver class from selenium API]
public class TestWebDriver {
static WebDriver driver = null; // initialization
//the below method is made static to call this method inside our package without creating any instance for it.
public static void setup(){
driver = new FirefoxDriver(); // inbuilt method called from selenium class
driver.get("http://www.google.co.in"); // opens the website which is written inside the braces.
}
}
Click to expand...
Click to collapse
5. Now Lets create another java class called FunLib and inside this what we do is we will try to enter some text into the edit text box of the Google website and also we will click on the search button. the code for this is as below:
import org.openqa.selenium.By;
public class FunLib extends TestWebDriver {
public static void Search() throws InterruptedException {
driver.findElement(By.xpath("//div[@id='hplogo']")).click(); // clicks on the Google Logo
Thread.sleep(3000); // sleeps for 3000 milliseconds
driver.findElement(By.xpath("//input[@name='q']")).sendKeys("RHBROMS"); // type as RHBROMS in the edit text field
driver.findElement(By.xpath("//button[@id='gbqfb']")).click(); // Click on the Search button
Thread.sleep(3000); // again sleeps for 3000 milliseconds
driver.findElement(By.xpath("//li[1]/div/div/h3/a")).click(); // Click on the first link that is rhbroms.com
System.out.println("button got clicked"); // displays the msg on console.
}
}
Click to expand...
Click to collapse
6. Okay now you might be thinking as how to identify the edit text field as well as other elements.!! Its easy for that we need some Extensions for FireFox they are as below:
7. After installing these Extensions we now see how to use them to Identify the objects. Thing is we don't use all these but some, It again depends on which tool u want to use!!. which one is best for you.
8. First I will show you how to Identify the Google Logo by using Xpath. To do this open FireFox and open Google website and right click on Google Logo and select View XPath. After this you will see something like as shown below:
9. As you can see from the image as XPath is given as : id('hplogo') but thing is how to use this in our code.. Simple just add the tag type in this case it is <div> (The <div> tag defines a division or a section in an HTML document.) the changes what u have to do is as shown in below Screen Shot.
10. Now the same goes for other objects too..!! If you find any doubts on this feel free to ask me by either commenting here or by emailing me.
11. Now we will see how to execute our first Automation Script in the next chapter.

5. Execution using Junit and TestNG
5. Execution using Junit ​
1. First we will see how to execute our script via JUnit Suit.
2. Let us create a new JUnit test case (project -> New -> Junit test case) as shown in below screen shot:
3. Now let us give the Junit test case name as "Junit" as shown below in the screen shot. NOTE: Uncheck setup and teardown options.
4. Okay as we are done with creating new Junit test case just do the below editing:
package com.rhb.selenium; // package name
import junit.framework.TestCase; // auto import
import org.testng.annotations.Test; // auto import to give annotations that are necessary
public class Junit extends TestCase {
@Test
public void test1() throws Exception{
Main m = new Main(); // creating instance for Main class as "m"
m.setup(); // as setup is a method which is declared under Main class we can access it using access specifier "m"
m.Search(); // as Search is a method which is declared under Main class we can access it using access specifier "m"
}
}
Click to expand...
Click to collapse
5. To run the above JUnit Test right click on Junit.java file -> RunAs -> Junit Test
6. When you run the Junit test FireFox runs automatically in WebDriver mode as shown below and all the operations that we have specified in the Main class will be performed. Screen Shot of this is as shown below:
7. The below snap shows the test case is pass and the color is changed to Green. And also we got a msg at console as "button got clicked" what we have written in FunLib.java !!
8. The Result at FireFox WebDriver should be as shown below:
9. Okay now we will see how to execute using TestNG ( Easy one )

5a. Execution using TestNG
5a. Execution using TestNG​
1. Don't worry it is very easy compared to JUnit.
2. I hope you have installed the plugin of TestNG to your Eclipse.
3. Lets Create a new java class with name TestNGSuite1. Copy paste the below code after creation:
package com.rhb.selenium;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.testng.annotations.Test;
public class TestNGSuite1 {
@Test
public void testngtest() throws FileNotFoundException, InvalidFormatException, IOException, Exception {
Main m = new Main(); // instance of Main class
m.setup(); // call for setup method
m.Search(); // call for Search method
}
}
Click to expand...
Click to collapse
3. Right click on TestNGSuite1.java file -> TestNG -> Convert to TestNG as shown in below screen shot:
4. Now you will see as below Screen Shot, here TestNG is converting our java file to executable xml format.
5. Now click on Finish button and you will see a Testing.xml file as shown below:
6. Now Just right click on the xml file -> RunAs -> TestNG Suite as shown below:
7. Finally you will see the final result as below:

6. DataDriven Testing using POI jar files and TestNG XSLT + ANT
6. DataDriven Testing using POI jar files​
1.We go for data driven testing when we have some modules that need to be tested for multiple values. For example in a application which has a login page with username and password field we have to test these edit text boxes for multiple inputs, It can be a number or it also can be a string or both together.
2. Here I will take Google.com as example and show you how to extract data from a excel file and push the same to Google website.
3. First we will create an excel file with some data present in it to test our application. (An Excel file for testing our app is attached here)
4. To extract data from Excel we use “FileInputStream” Class by which we can create/delete and modify a file.
5. Now add POI.jar files to Java Build Path same as how we added Selenium Jar file.
6. After adding of POI jar files to Java Build Path you will see them added as shown below:
7. After this is done we will create a new java class and will give the name as "DataDriveTest" and extend it from "TestWebDriver" Class.
8. Now what we will do is we will open google.com enter "search" value as "RHBROMS" ( 1st value from the excel sheet ) click on the first link and then we will click on back button of the browser and then we will clear the search box and enter "xda developers" ( 2nd value from the excel sheet ) and click on first link that will be xda developers website.
9. The code for this is as written below with explanation.
package com.rhb.selenium;
// below package imports are for File I/O operations
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
// below packages are for excel sheet operations
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.openqa.selenium.By;
public class DataDriveTest extends TestWebDriver {
public static void test() throws Exception, IOException,
FileNotFoundException,InvalidFormatException {
String cellval1 = null; // set the current value of cellval1 as NULL
String cellval2 = null; // set the current value of cellval2 as NULL
FileInputStream fis= new FileInputStream("E:\\Test.xls");
Workbook wb = WorkbookFactory.create(fis); // creates object for workbook Test.xls
Sheet ws = wb.getSheet("Sheet1"); // opens Sheet1 from workbook Test.xls
int rc = ws.getLastRowNum(); // counts the number of rows which are used
for(int i=1; i<=rc; i++)
{
Row r = ws.getRow(i); // ponts to the i'th ROW
for (int j=0;j==0;j++){
{
Cell c = r.getCell(j); // points to the j'th Column
cellval1=c.getStringCellValue(); // gets the data from J'th cell
Cell c1 = r.getCell(j+1); // ponts to the J+1'th column
cellval2=c1.getStringCellValue(); // gets the data from J+1'th cell
driver.findElement(By.xpath("//div[@id='hplogo']")).click(); // Clicks on the google logo
driver.findElement(By.xpath("//input[@name='q']")).sendKeys(cellval1); // take the first value from first column and paste it at the search box
driver.findElement(By.xpath("//button[@id='gbqfb']")).click(); // clicks on the search button
Thread.sleep(3000); // sleeps for 3000milisecs
driver.findElement(By.xpath("//li[1]/div/div/h3/a")).click(); // clicks on first link
driver.navigate().back(); // clicks on the back button of the browser
driver.findElement(By.xpath("//input[@name='q']")).clear(); // clears the search box
driver.findElement(By.xpath("//input[@name='q']")).sendKeys(cellval2); // enters the second value from the excel sheet
driver.findElement(By.xpath("//button[@id='gbqfb']")).click(); // clicks on the search button again
Thread.sleep(3000);
driver.findElement(By.xpath("//li[1]/div/div/h3/a")).click(); // clicks on the first link
}
}
}
}
}
Click to expand...
Click to collapse
10. Now to execute this we have to do some editing at Main.java file as:
Code:
public class Main extends DataDriveTest {
public static void main(String args[]) throws FileNotFoundException, InvalidFormatException, IOException, Exception{
setup();
test();
}
11. And also in TestNGSuit1.java file as:
Code:
@Test
public void testngtest() throws FileNotFoundException, InvalidFormatException, IOException, Exception {
Main m = new Main();
m.setup();
m.test();
}
12. Now as usual convert the TestNGSuit1 file to TestNG and execute. :victory:
13. To see your TestNG results go to your eclipse workspace and open selenium project inside that you will find test-output folder. As shown in below Screen Shot:
14. For Generation of Graphical and more clean Results we use TestNG xslt with ANT. lets see how to do it in Next Chapter :laugh::laugh:
6. TestNG xslt with ANT ​
1. Download Ant from here: http://ant.apache.org/
2. Unzip it and rename the folder as ant.
3. Set ANT_HOME to environmental variables.( In windows 7 Right click on Computer -> properties -> “Advance system setting”
-> Choose Advanced Tab
-> Press Environment Variables Button
-> In the System Variables, click New Button
Give the Variable Name:ANT_HOME
Give the Value: E:\ant
Click OK )
as shown in Below Screen Shot.
4. Set ANT_HOME path,
go to path
Give the Value C:\ANT\bin
Click OK
5. To check ANT works properly or not
In the command prompt, type:
Code:
ant -version
you will see as below Screen Shot:
6. Now download testng-xslt from HERE
7. After this extract the downloaded zip file and go to testNG-xslt -> src -> main -> resources and copy the file testng-results.xsl and also copy this file from testNG-xslt -> lib that is saxon-8.7.jar and keep them at any folder for time being.
8. Now go to your project workspace and goto SeleniumTest -> test-output and paste testing-results.xsl that you copied.
9. and now goto eclipse and add saxon-8.7.jar to buildpath.
NOTE: the thing is you have to keep all your jar files in a same folder as I have kept at jar folder as shown below in my setup:
10. Now after doing all this create new xml file and call it as Build.xml
11. After creating this just copy paste the below code:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="SeleniumTest" default="compile" basedir=".">
<path id="cp">
<pathelement path="bin" />
<fileset dir="jars"/>
</path>
<!-- for compiling -->
<target name="compile">
<javac classpathref="cp" srcdir="src" destdir="bin"/>
</target>
<!-- for running -->
<target name="run" depends="compile">
<java classpathref="cp" classname="org.testng.TestNG" args="testng.xml"/>
</target>
<!-- for report generation -->
<target name="report" depends="run">
<xslt in="./test-output/testng-results.xml" style="./test-output/testng-results.xsl" out="./test-output/testng-xslt.html">
<param expression="${basedir}/test-output/" name="testNgXslt.outputDir" />
<classpath refid="cp"/>
</xslt>
</target>
</project>
12. After this save the file.
13. Now right click on the project and do as below and select TestNG:
14. Now Run the Build.xml file. and your results will be stored at Index.html at test-output folder.
To be continued .. NEXT will be Maven with TestNG!!

Excellent..
This tutorial helps in starting up with Selenium with all the configuration.

Thanks
Swaroop Bandagadde said:
This tutorial helps in starting up with Selenium with all the configuration.
Click to expand...
Click to collapse
Thank you @Swaroop Bandagadde for helping me to write this Tutorial !!..:victory:

Related

[Q&A] AROMA Installer - [Dev Move To DevDB]

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The World's First ANDROID Touch And Customizable ROM Installer
DEVELOPMENT AND UPDATE NOW ON XDA-DEVDB
AROMA INSTALLER THREAD
Don't Forget To Donate To Me:
When you install Linux, Windows, Mac or applications on the PC
You can always customize your installation as you want.
WHY CAN'T WE DO THE SAME INSTALLING AN ANDROID ROM?
BECAUSE NOW
AROMA Installer
GIVES YOU THIS POSSIBILITY!​​
For Questions and Answer about scripting and customizing your Installer, please post your problems in Q&A Thread below:
AROMA Installer & Edify
Q & A THREAD​
Need stunning AROMA Installer Package Creator in GUI:
Aroma App Package Creator
by commandersafi​YOU DON'T NEED TO USE TOUCH RECOVERY TO MAKE THE TOUCH SCREEN WORKS
If your Recovery Kernel include Touch Screen Driver, even if the recovery not supported touch screen, it will works.
And Almost any recovery included touch screen driver in its kernel (Except some trimmed versions)​
-------------------------A-R-O-M-A---I-n-s-t-a-l-l-e-r-------------------------​
Benefits For Users
AROMA Installer gives users the possibility to choose which mods and applications they want to Install on to their device. Sometimes we want the clean install, without bloatware; and sometimes we want the full set of applications on our device. With AROMA Installer, you are your phone's master!​
Benefits For Chefs/Developers
AROMA Installer gives chefs many benefits:
You don't ever again have to hear someone ask to remove or include something they like into your ROM, just for you to yell "Hey, that is only your opinion! Only you and some other people like it; most people don't! Go remove the apps on your own with WINRAR, you ^$#&*&#$", remember they are still a customer , and with AROMA Installer, this problem can be solved.
If you are good at customizing the AROMA Installer it was possible to make your ROM compatible with many devices using just one ROM File. You save your time, bandwith and hosting maintanance.
With the great user interface in your ROM installation, users will be very happy with it.
With AROMA Installer, You Are The Greatest ROM Developer​
-------------------------A-R-O-M-A---I-n-s-t-a-l-l-e-r-------------------------
NEED DIRECT SUPPORT? - JOIN #aroma CHANNEL AT FREENODE.NET​
-------------------------A-R-O-M-A---I-n-s-t-a-l-l-e-r-------------------------
Videos
Watch this video to learn about AROMA Installer. Thanks to XsMagical for creating this awesome video...
Screen Shoots
​
more at amarullz.com [+]​​
FROM INDONESIAN DEVELOPERS TO PEOPLE AROUND THE WORLD​
Downloads & Resources
FOR ROM CHEFS ONLY
ROM CHEF? WHAT IS THAT? ... HERE IS A VIDEO
DON'T ASK ABOUT HOW TO INSTALL IT, BECAUSE IT MEANS YOU DON'T KNOW WHAT IT IS FOR
IT ISN'T AN APPLICATION YOU CAN USE OR INSTALL ON TO YOUR PHONE LIKE ANGRY BIRDS OR FACEBOOK
IF YOU JUST A USER, THEN FIND A ROM THAT ALREADY USES THIS INSTALLER​
MOST IMPORTANT THING BEFORE CUSTOMIZING IT
Make sure You took an update-binary from a working ROM,
renamed it to update-binary-installer and overwrote the one in my AROMA Installer zip​
Download Binary
Version 3.00b1 - MELATI
BUILD:15022833
NOTE WILL ONLY WORKS ON DEVICE WITH ARM NEON SUPPORT
Recent Changelogs:​
FLAMBOYAN MELATI- 3.00b1
new engine fb & input driver
support msmfb overlay
more neon improve
tweaks some ui
graphics processing
Download Binary
Version 2.70 RC2 - FLAMBOYAN
BUILD:130903
NOTE WILL ONLY WORKS ON DEVICE WITH ARM NEON SUPPORT
Recent Changelogs (FLAMBOYAN BETA):​
FLAMBOYAN BETA - 2.70B1-B6
-
BETA-6
Fix some back sequence (thanks Electronic Punk) - Small but Important fix aparse_current_position++ to ++aparse_current_position. ( https://github.com/amarullz/AROMA-In...1bba2d02988c60 )
-
BETA-5
Fix Commented NEON - Now Fast Again
New Themes
New Stack Transition, and smoother dialog transitions
Add ini_set("transition","stack");
Add Screenshoot (Volume Down+Power Button) - Image Format BMP-565 16 bit
fix ini_get function
Whole new input driver
Optimize alphablend processes
Optimize and Add Drawing Scale Nearest Neighbor
Add drawing functions for alphablend
Dialog In & Out Transition
Cache recovery display for exit transition
Add Exit transition
fix force_colorspace issue
add colorspace change demo
remove unneeded sleep for faster start and exit
-
BETA-4
Fix Icon Themes Error
Change Transition Animation - Slides for next/back - Smoother than alpha blend animation
Remove any transition effect for Dialog Window
Use Bold Text for Navigation Button
Fix Installer UI for text log position
Add ini_set/ini_get for Vibrate Intensity (0-10). ini_set("vibrate","5") = Half Intensity, ini_set("vibrate","0") = No Vibrate At All
Add ini_set/ini_get for icon_back and icon_next. ini_set("icon_next","@install"), ini_set("icon_back","icons/back")
Fix Installer Freeze on (pthread_detach) - Compileable for Android Build Environment
BUILD WITH ANDROID BUILD ENVIRONMENT - Binary Size Reduce By ~60% - BUILD COMMAND: make aroma_installer; make aroma_installer.zip
Add zip build command in building the source
Rewrite building script for windows and linux with Android Build Environment
Modify aroma-config in demo zip to includes some new features
Change update-binary-installer from Galaxy Nexus binary. Sensation user should replace it binary with sensation binary
Beautifier Source Code. Add beautifier tools in source code tree
-
BETA-3
Fix Include Back Error
Improve Back Sequence Capability
ADD EVAL Function to execute the script inline from string
ADD GOTO Function to jump back into GOTO Label. gotolabel(), goto().
Update More Demo in Example Zip
Improving Efficiency processes when loading and reloading themes
-
BETA-2
Fix color handling on themes
Using bilinear scaling in png.9p
Re-add hebrew support
Add Italic Support with tag \<i>Italic\</i>
ADD include function, to include script from different file. look at new aroma-config file and language_select.edify file
-
BETA-1
reboot("now","recovery"); and reboot("now","fastbot");
Refresh look and feel
Remove RTL and Arabic Support (For faster and freeing resource, because the features still unusable)
Subpixel rendering for Fonts (Clear Type Like)
Improve performance with NEON here and there.
Tweaks some input driver
May fix some colorspace issue
Bilinear scaling for png icons, Now it look smooth even if it resized
FIX MANY BACK SEQUENCE BUGS
Font will only loaded if the font is really changed - Faster-faster performance improvement
Change Navigation Bar Buttons. Now next and back can be using Icons
Add Menu Button for buttonless devices.
Version 2.56 - EDELWEIS
BUILD:121004-031 - New Touch Handler + Fix Capacitive Button
WITH TRUETYPE, MULTILANGUAGE, UTF8
Recent Changelogs:​
EDELWEIS - 2.56 - BUILD 121004-031
Fix capacitive button
Remove calibration tools
EDELWEIS - 2.55 - BUILD 121003-030
Completely new Input/Touchscreen Handler - Thanks to agrabren from TWRP
Remove all calibration need. calibtool(), calibrate() and calibrate_matrix() won't do anything now.
EDELWEIS - 2.51 - BUILD 120810-026
Supported Galaxy Nexus Touch Screen - And maybe other devices now supported
EDELWEIS - 2.50 - BUILD 120716-025
Add Calibration Matrix for More Accurate Touch screen calibration
Set ROBOTO as Default True Type Font
DAHLIA - 2.00 - BUILD 120425-020
Fix Installation Save Logs
Fix framebuffer mmap size
Fix status 0 error
Add Multilanguage functions
Change list bullet drawing method
Add support for kerning font when use TrueType/OpenType
Add AROMA Memory management and memory debuging build (COMPILE FROM SOURCE ONLY)
Add more limit size for AROMA texts
Add font glyph cache for faster freetype drawing & processing
Add support for Modern Standard Arabic
Add support for RTL
Add support for TrueType and OpenType fonts
Add support for UTF8 encoding in aroma-config and all AMS text. For updater-script use NO-BOM UTF8
Fix Memory leaks
Add ini_set("force_colorspace","rgba");
Add support for atmel_maxtouch - Asus Transformer Touch Screen
CEMPAKA- 1.64 - BUILD 120414-040
Fix framebuffer mmap size
Fix status 0 error
Previous Changelogs:
Code:
[LEFT]
* [B]CEMPAKA- 1.63 - BUILD 120306-032[/B]
* Add support for atmel_maxtouch (Down Event SYN) - Asus Transformer Prime Touch Screen
* [B]CEMPAKA- 1.62 - BUILD 120303-030[/B]
* Fix some memory leaks ([COLOR="Red"]Important[/COLOR]).
* Add ini_set("[COLOR="Green"]force_colorspace[/COLOR]","rgba");
* [B]CEMPAKA- 1.60 - BUILD 120227-026[/B]
* Add msb_right check for Endianess video memory
* Fix Installer text log drawing
* Add ini_get
* Add rom_date in ini_get
* Fix reboot and back function
* Add more and recreate Icons for themes and generic
* Rewrite text handler
* Add alignment, indentation and list in AROMA Markup String
* Change temp directory to /tmp/aroma, /tmp/aroma-data stil works
* Add Theme Support
* Add AROMA Markup for <b> Bold
* Add More Colorset
* Add More Text to Customize
* Add PNG Icon Load From Theme (Default Icons)
* Add Tab support in AROMA Markup String
* Change int to long for partition info, now support big storage information
* Config Init All/Theme Only
* Recreate new example (release) for binary release
* Customizable Font Runtime
* Reformat About Dialog
* Add show progress per time in installer (now support by files and by time).
* Themeable Progressbar
* Enhance Exec Functions to return exit status and autosave buffer into variable
* Fix glibc error in ag_close - Need workaround
* Move ai_trim to system libs
* Add Stretch function for png
* Add 9 Patch drawing function for png
* Fix Reboot Function
* Add Alternative Touch Method
* Add ziptotmp & restotmp
* Add support for mxt224 touch screen (SYN_MT_REPORT event)
* [B]BOUGENVILLE - 1.10 - BUILD 120208-13[/B]
* Add Alternative Touch Method
* Added New Functions
- anisplash - ANIMATED SPLASH SCREEN
- prop - GET PROP FROM AROMA TMP
- zipprop - GET PROP FROM ZIP
- resprop - GET PROP FROM AROMA RESOURCE ZIP
- sysprop - GET RECOVERY PROP
- property_get - GET RECOVERY PROP
- write - WRITE STRING INTO FILESYSTEM
- readtmpfile - READ TEMPORARY FILE AS STRINF
- read - READ FILESYSTEM AS STRING
- zipread - Read String From Zip
- resread - Read Strinf From Resource
- zipexec - Exec Program From Zip
- resexec - Exec Program From Resource
- run_program - Run Program/Exec
- exec - Run Prohram/Exec
- back - BACK TO PREVIOUS WIZARD
- reboot - REBOOT DEVICE
* Deprecated Funcrions
- readfile - Will Renamed to zipread
- readfile_aroma - Will Renamed to resread
* Add Some Fix in Touch Up Handler
* Prop parsing, File Handling & Zip Handling has been managed in efficient functions
* Remove CERT.SA - Not Needed
* Add Licence Headers in all aroma source code Apache 2.0
* Add More Comments & Documentation in Souce Code
* Renamed functions for fit needs
* [B]ANGGREK -1.00 - BUILD:120204-011[/B]
* Fix calibrating function not working when set in aroma-config
* Update and fix firmware command from update-binary-installer into recovery.
* [B]ANGGREK -1.00 - BUILD:120202-10[/B]
* Improve touch handler compatibility. Now more accurate in every devices
* Add more chars into ROM Infos from only 31 to 63max
* Detail changelog from commit: [URL="https://github.com/amarullz/AROMA-Installer/commit/f49e2969e3b3514e180dcb15bed5a48298b19046"]10[/URL]
* [B]ANGGREK -1.00 - BUILD:120201-009[/B]
* Stride/Pitch/Padding Framebuffer support for non multiply 8 screen size like qhd on sensation and evo3d
* Rewrite input handler, better keys & touch screen compatibility.
* Change calibration division data from integer to float, more accurate calibrating
* Improve fling and scrolling engine
* Add support for all possible screen bit depth 32/24/16bit. ARGB, ABGR, RGBA, BGRA. No problem now.
* Detail changelog from commit: [URL="https://github.com/amarullz/AROMA-Installer/commit/b9daae9151e6ec4e1054725722b6f507f621f065"]006[/URL], [URL="https://github.com/amarullz/AROMA-Installer/commit/65fdbb9a2f7c12a799f320b3759ab60d6b00d3b1"]007[/URL], [URL="https://github.com/amarullz/AROMA-Installer/commit/f49e2969e3b3514e180dcb15bed5a48298b19046"]009[/URL]
[B]ANGGREK -1.00 - BUILD:120129-005[/B]
* Remove Signature Check - Now You don't need to sign aroma-config and updater-script
* Calibration Tool now show before anything, so you can directly do calibration. you can disabled it in aroma-config by deleting [B]calibtool("");[/B] command.
* Fix some touch screen input handler
* Add 229 in menu keycode (F2 used in emulator as menu key)
[B]ANGGREK -1.00 - BUILD:120128-004[/B]
* Open Source - Binary No Released
[B]ANGGREK -1.00 - BUILD:120126-003[/B]
* Refer to defy recovery source code found [URL="https://github.com/CyanogenDefy/android_device_motorola_jordan/blob/gingerbread/recovery_ui.c"]HERE[/URL] (Thanks [URL="http://forum.xda-developers.com/showthread.php?t=1356767"]walter79[/URL] for github source code) I add some keycode into input reader : [URL="http://forum.xda-developers.com/showpost.php?p=21826756&postcount=32"]Read Here[/URL]
* Add confirmation if calibrated data will be used in current process (After Calibrating) - So you can try touchscreen without editing [COLOR="Green"]aroma-config[/COLOR] after you calibrate it.
* Remove precision calculation in scrolling thread (Natural calculation but less fluid)... Feel faster now.
* Add function for [COLOR="Green"]aroma-config[/COLOR] to define custom key code for up/down/select/back/menu, just like [COLOR="Green"]calibrate()[/COLOR] function. with format like this: [COLOR="DarkRed"]ini_set("customkeycode_up",130);[/COLOR] or [COLOR="DarkRed"]ini_set("customkeycode_select",13);[/COLOR], the keycode can be capture by [URL="http://forum.xda-developers.com/attachment.php?attachmentid=872892&d=1327550395"]aroma-keycapture-flashable.zip[/URL]
[B]ANGGREK -1.00 - BUILD:120125-002[/B]
* Add Home & Power Button To Select Items
* Unsigned Script Now Not Terminated Installer, but just show Alert That the script should be signed to pass install ui
* Add More Documentation in aroma-config
[B]ANGGREK -1.00 - BUILD:120124-001[/B]
* Initial Release ( AROMA UI, AROMA Touch Handler, AROMA Markup String )
* Customizable ( Custom Theme Colors, Customizable Fonts and Images )
* Optimized Build ( Static, -o2, remove unused functions, remove png-write and zlib deflate functions )
[/LEFT]
Open Source?
There may be some people who will ask if the project is Open Source, and the quick answer is YES. It is an Open Source Project Now.
Why Release The Source?
I used some other work (modified) from the Open Source Community, especially Koush's recovery source code for getting the input mode, PNG, ZLIB, and some Framebuffer programming samples.
I want to make all chefs feel safe, so I guarantee that I won't make this into a money making program.
I got something from the community, and I want to give something back to it.
What Benefits?
Rapid development
I can get code review & patches - Not just bug reports
There are many innovations that I wrote in the program that may be useful for other needs, like the AROMA Graphic Framebuffer, the AROMA UI, the Amarullz Dithering Method, and the AROMA Simple PNG Fonts. It may be used in recovery, so recovery can use the AROMA Installer Interface
I can learn more about Open Sourcing programs (especially the CVS and licensing things - that always drive me to the question - what is it?)
I Need Help
As I said before, I am just a newbie at Android Development, or even as a user. I need someone who has a lot of knowledge about Open Sourcing the software, and a lot of knowledge about licencing (I don't know much, I just tried to make my software compatible with them: GPL, Apache, etc.)...
Thanks.​Source Code
https://github.com/amarullz/AROMA-Installer​
TOOLS: AROMA Key Capture
I also created "aroma-keycapture-flashable.zip" to capture the keycodes of your device (flashable in recovery - won't flash anything ). And in case the keys don't work, report the keycodes in this thread, with information like this example:
DOWNLOAD IT HERE​
Code:
Prev Item/Up Key = 120
Next Item/Up Key = 110
Select Item/Enter/Select Key = 13
Back Key = 200
Menu Key = 193
To customize keycodes, open aroma-config and modify this code:
Code:
##
# Custom Key Code - Usefull For Some Device which not used
# Standard key code for up/down/select/back/menu
#
# You can capture the keycode in
# recovery using "aroma-keycapture-flashable.zip" Available in
# AROMA Installer Thread.
#
# Press some key when it run, it will return key code,
# that key can override up/down/select/back/menu actions in
# AROMA Installer, you can even set your home key for up, or
# volume down for select item
#
#-------- Uncomment & Modify this Code:
#
# ini_set("customkeycode_up", "115");
# ini_set("customkeycode_down", "114");
# ini_set("customkeycode_select", "116");
# ini_set("customkeycode_menu", "139");
# ini_set("customkeycode_back", "158");
#
AROMA Installer Resources
The Codenames
AROMA Installer codename based on Alphabetical Indonesian Flower Names. Here the list of already used codename:
ANGGREK - 1.00
BOUGENVILLE - 1.10
CEMPAKA - 1.60 - 1.64
DAHLIA - 2.00
EDELWEIS - 2.50
FLAMBOYAN - 2.70
​
Programming Language
It was application which runs on Android device but not on Android OS Environment that the native applications usually use Java. AROMA Installer use C (Pure C, not C++), so it may run on another platform like x86 with small modifications ofcourse.​
Used Libraries
ZLIB - ofcourse, it was the most awesome thing in computer world :good:
PNG
MinZIP
Freetype
All library need to compiled as static to make sure it runs without any dependency issue in any devices.​
Official Binary
I Only support ARM device, but it was opensourced, so anyone can play with the source and compiled it for they own devices.​
ROM That Already Uses AROMA Installer
HTC Desire (BRAVO):
RunnyMede AIO Special Edition | ICS MIUI_Au v4 2.2.17 Beta | ICS for Desire | MIUI v4 ICS Rom (PORT) | Aurora v6 | Cibernodo Mod2Bravo | miui-france Unifée
HTC Sensation:
Sense-o-Maniac | InsertCoin Ice Cream Sandwich | ELEGANCIA™ Rom Series-ICS
HTC Inspire 4G:
BHS Roms RC9 | hylz MIUI
HTC Supersonic: EVO 4G:
LiGux for Supersonic
Samsung Galaxy S I9000:
Tiramisu+
HTC EVO 3D:
KingCobra3D
Incredible S:
Nik_IncredibleS_TriNiTy
HTC Incredible S:
Valhalla | BlackEdition
Asus Eee Pad Transformer Prime:
Virtuous Prime
Motorola Defy / Defy+:
MIUI-Pikachu | WhiteRabbit Edition
LG Optimus Black:
Marvel Special Edition
LG Optimus 2x:
Nova HD Plus
LG Optimus 3D:
Vengeance O3D Edition
Wildfire S:
[WFSDEV] .sense
Samsung Galaxy Gio GT-S5660:
CyanogenMod 7.2-GIO-KANG
MOD/THEMES Uses AROMA Installer
MetallicBlue Theme and app-deleter for Samsung Galaxy S2
3rd Party AROMA Installer Resources
SGS4G CWM ROM Installer - an AROMA based Touch UI CWM Installer As seen on Valhalla Black Final
If you release the ROM with AROMA Installer, please inform me here, I will add your ROM in this post.​
Thanks for Donators
Steve0007 ( ****** )
TweetyPeety ( *** )
Riza Nugroho (**)
Midian666 ( ** )
lenny_kano ( ** )
Turge ( * )
baadnwz ( * )
Dev / zen ( * )
blk_jack ( * )
Patrics83 ( * )
T Roach ( * )
eladavron ( * )
Yoed Stavi ( * )
roy tampubolon ( * )
Sebastiaan15 ( * )
Lars Kuno Michaelsen ( * )
V6-Maniac ( * )
FBis251 ( * )
avss ( * )
Jonathon Fitch ( * )
Gerrett ( * )
Matthew Flack ( * )
RaymondY88 ( * )
D Wood ( * )
Kaskade ( * )
dorimanx ( * )
mickey-r ( * )
Thanks To
Sebastiaan15 - For using and test it for the first time
avss - For helping me to make it works in sgs2 and many samsung devices
DemonWav - For helping grammar in the thread, Testing and give many great ideas.
-viperboy- - For intensively testing & feedback the touch screen in EVO3D CDMA
baadnwz - For Testing the touch input in sensation
capychimp - For Testing Display
Prof Peach - For helping and testing
V6-Maniac - Creating Video
About AROMA Installer
BackgroundAndroid has an advanced system for installing the OS and updates, unlike other mobile OS's that distribute the contents of the OS in static ROM image(s), Android distributes the OS and updates in a plain .zip file that contains all of the packages, files, and the updater for processing the installation.
The updater splits in 2 types, the binary (update-binary) and script (updater-script), while the binary is an executable file, and the script was a configuration script that tells the binary executable what to do.
But this advanced technology never expanded into its highest potential ability. The update-binary was simply the linux executable wrote in C that runs in root mode, and can do anything to your system; including accessing the Display FrameBuffer, accessing keys and the touch screen, set vibrate, run programs, parse files, load png(s) and .zip's, and read and write to the filesystem.
The old update-binary only supported a few functions that can controlled only by the updater-script to instal the files. It didn't have a single function that allowed the installer to interact with the user. There is a program called "yesno" that shows a "Yes" or "No" interface, but it wasn't enough to create a more customizable updater.
Now with AROMA Installer update-binary, all of this limitation is gone, and this advanced technology is expanded to the highest level of its pontential.​Read More at amarullz.com [+]​
What is AROMA Installer"AROMA" was taken from Bahasa Indonesia (Indonesian Language) and it means "Scent", but it is also an abbreviation of "AMARULLZ ANDROID ROM MANIFESTATION". It is an advanced update-binary for Android that contains many features like Wizard Installation, Touch User Interface (AROMA UI), Customizable Packages, System Inspecting, Themeable, and User Interactive. All release versions will have "flower" codenames, for example, the 1st version is codenamed "Anggrek", which mean "Orchid".​
How AROMA Installer WorksHow can it work in recovery mode, and how can it so smooth when it scrolls? It works because I hired Chuck Norris to force the recovery to run the installer, and the phone is too afraid to show any lag .
No, seriously, when the user selects the .zip file to install it, the recovery will extract the update-binary and run it with a few arguments. All processes are handled by the update-binary, and the recovery will only show the information passed by update-binary via a custom pipe. The great thing is that the update-binary can do anything if we can code it in C/C++, but not all people can easily play with C/C++. Its also not very effective or fun to compile it every time we need to change the process. That's why the custom script is used in AROMA Installer, it is simply edify scripting that is used as the normal updater-script, but with expanded functions available.
It wasn't a simple thing to archive something like this, because the update-binary is simply the "linux executable" that doesn't even support dynamic links of libraries, basic drawing functions like drawrect, drawline, and I don't think it OpenGL can be included in it's binary. It runs on it's own. Even User Interface was wrote from scratch to manipulate directly into the display framebuffer, user input was read directly from the raw kernel input device, png and .zip was read with a static link library, and the configuration was parsed in it's own program. It is the result of one full month of developing, but you can learn it instantly, without any need to know how to manage memory usage and pointers.
The AROMA Installer will read, parse, and run the script commands to show it's UI, calculate partition sizes, create, read, and write temporary prop files, set & get variables, do simple integer comparisons and math sequences, do the if else or inline if conditions, configure the UI color scheme, configure rom information, and much more.
Because it was very complicated and needed a lot of time to develope, did I earn some reason to get donations?.​Donate To Me [+]​
Flowchart How It Works
​
more at amarullz.com [+]​​
Customizing AROMA Installer
Best Practice to learn about Customizing AROMA Installer was read and edit the aroma-config and updater-script directly from downloaded files, or for the completed features (but not well documented) was read aroma-config and updater-script from RunnyMede AIO,
Download RunnyMede AIO AROMA Installer Scripts!
And Some Interesting Answered Questions from TweetyPeety by me Here​
Customizing Your Script
AROMA Installer can be configured and customized as you like, there is so many features and functions you can used to implemented many things. In this manual, we will learn all the features and functions in technical ways and can be implemented directly in configuration for practice, or production.​
AROMA Installer Zip Directory Structures
AROMA Installer use standard ClockWorkMod zip Installer structures. All configurations will be placed in META-INF Folder in zip contents. Here the example directory structure for AROMA Installer:
All AROMA Installer files, should be placed in META-INF/com/google/android/. There is 2 Binary files, and 2 Script/configuration files, and 1 resources folder.
aroma – Aroma Assets/Resource folder, It contains custom files, like png fonts, png icons, png splash images, text file for changelogs or agreement/license.
aroma-config – It was main AROMA Installer configuration script. This configuration was the one that supported AROMA Installer functions like Wizard UI's, Installer UI, Dialog UI, get and set variables, etc. This script wrote on Edify Script Sintax (See next chapter). This script not supported functions to manipulate system files/extract files and other installing method. It's only configuration to prepared all needed data for updater-script.
update-binary – It was AROMA Installer Executable, the compiled program wrote by me in C, and it was the program that show User Interface.
update-binary-installer – It was old update-binary (renamed to update-binary-installer), will be runs on Installer UI when the installer need to flash/install/extract files from zip to the phone.
updater-script – It was old edify format to start copying/install/extract files from zip to the phone. It will only support old functions that supported by update-binary-installer, but can read prop files created by AROMA Installer.
AROMA Installer Assets Directory
AROMA Installer use others files to show the interfaces, The Interfaces like windows, dialog, title, rounded rectangle and simple drawing was implemented by executable used compositing colors configurations, but for others drawing like text and icons, AROMA Installer will read zip contents in this asset directory.
The minimum requirements in this assets directory was png fonts files (big and small). It placed in fonts directory, an Icons can be placed in any directory of aroma assets, but for cleaner locations, it recommended to placed all icons in icons directory, And there is some default icons like alert.png, install.png and info.png that should be placed in this directory, because the installer executable was hardcoded icons locations like icons/alert.png for confirmation, icons/install.png for about dialog.
All splash and text files can be placed in anywhere but inside this assets directory. Example when you want to read text file into variable, use:
Code:
setvar("changelogs",readfile_aroma("changelogs.txt"));
It will find META-INF/com/google/android/aroma/changelogs.txt.​
Link Between aroma-config and updater-script
It was main section to be knowing by anyone that how can the aroma-config communicated with updater-script, so please read it carefully.
aroma-config and updater-script runs in different process, and can't share it's memory resource, so the only possible way to communicate is with temporary files. updater-script was original updater-script commonly used in old installer (without AROMA Installer), it's only supported bunch of functions to be used for manipulating system files, like delete_recursive, set_perm, format, mount, package_extract_dir, etc. But it's also support 1 function for read prop file, it was file_getprop.
That's why the AROMA Installer UI always save the result in prop files ( checkbox, optionbox, menubox ). Other than the UI, aroma-config has the feature to create temporary file in plain text (writetmpfile) which able easily create prop files.​Prop File FormatThe prop file format was simple plain text format with (=) token as delimiter between key and values, and newline as delimiter between one key=values with another key=values.
Code:
key1=value1
key2=value2
key_3=value3
last.name=amarullz
It can be easily accessed with file_getprop in updater-script like this:
Code:
file_getprop("example.prop","key1");
With above code, the file_getprop function will return the value of key1, it will returned "value1". We can use it for our needs in if/if else statement. We can use others characters in keys, like dot (.) and underscore, but please be careful, that you don't add some quotes in the values. Here the wrong prop file format:
Code:
key1="value1" [COLOR="Red"]# add quotes[/COLOR]
key2="value2" [COLOR="Red"]# add quotes[/COLOR]
first name=james [COLOR="Red"]# Key name with space[/COLOR]
AROMA Installer Default Prop Temporary Locations
When playing with AROMA Installer aroma-config files, almost all things that manipulated prop files will be saved relatively on AROMA temporary directory located in /tmp/aroma-data/, so if we pass the prop filename like this: writetmpfile("test.prop","key1=ok");, the test.prop will be located at /tmp/aroma-data/test.prop.
Quick Example
In this example case, the aroma-config will create temporary prop file that will be readed by updater-script:
aroma-config:
Code:
writetmpfile(
"kernel.prop",
"snq =yes\n"+
"call.2way=no\n"
);
updater-script:
Code:
if
file_getprop("/tmp/aroma-data/kernel.prop","snq") == "yes"
then
# Install Kernel
write_raw_image("/tmp/boot.img", "boot");
endif;
if
file_getprop("/tmp/aroma-data/kernel.prop","call.2way") == "yes"
then
# Do Something here
else
# Do Something here
endif;
With this feature, it's enough to archive customizable installation, and the aroma-config will be able to communicate with updater-script.​
EDIFY SCRIPT
Edify Script was simple script sintax to configure the behavior of binaries executable. In AROMA Installer, there is 2 edify script in the META-INF/com/google/android folder. The aroma-config and updater-script. Both files has it own use, and accessed by different binary executable, but use the same sintax, It's called edify.
The aroma-config used to configuring the UI in AROMA Installer, it will accessed directly by AROMA Binary Executable ( update-binary ), and updater-script will be used to configuring commands for installations (extract files, create symlinks, change permissions, format, mount, etc), and will be accessed directly by update-binary-installer. This couple script use the same sintax but have different functions that can be used.​Basic Edify SintaxEdify Script was function base script, similar to C language, but without any supported statement except if else. You also can't create function, only bundled functions available for the script. All commands will call functions name with some arguments, and ends by semicolon, like this:
Code:
function_name( argument1, argument2, argument3 );
Edify also supporting simple concat-ing string, just like some other languages like Javascript or Java. Using plus (+).
Code:
function_name("Concat this " + "Strings" + " as one argument");
All Edify function's arguments was in type string. Edify doesn't support others data type, however, we can insert some integer values into arguments, but it in the fact it will be treated as string.
Code:
function_name( 50, 20, "55" );
We can't do any math calculation in edify script, so the script below is invalid:
Code:
function_name( 50 + 50 );
If you use the string with plus operator, it will only concat the strings just like the 2nd example:
Code:
function_name( "50" + "50" ); [COLOR="Green"]# Result = "5050"[/COLOR]
For commenting the code, we can use the sign character (#), only line comment was supported, just like an unix shell comment sintax:
Code:
[B]# This is comments[/B]
function_name("Lorem ipsum dolore…");
Code writing isn't strict, so we can safely use space or new line between function and arguments:
Code:
function_name(
"First Argument",
getvar("config"),
"Third Argument"
);
The functions in Edify Script can returned values. But just like an arguments, it's only supported string type data. The good thing is this String can be converted into Boolean for conditions need. The string with contents will have true Boolean, and the empty string will have false Boolean.
"" = false
"1" = true
"yes" = true
"no" = true
"0" = true
Control StructuresEdify only supported limited control structure. Only if, and if else supported. But this control structures is enough to make an interactive installer. The basic sintax of if structure is:
Code:
if
"comparison"=="comparison"
then
.. commands ..
endif;
And for if else structure is:
Code:
if
"comparison"=="comparison"
then
.. true commands ..
else
.. false commands ..
endif;
We don't have any looping control structure, the Next and Back features in Wizard UI was handled by program automatically.​Comparison & Logical OperatorsEdify script doesn't supporting arithmetic operators, but it supported simple comparison and logical operators, Just like other programming languages base on C (java, php, javascript). It use simple operator sintax:
Code:
# Equal
val1 == val2
# Not Equal
val1 != val2
# Or
val1 || val2
# And
val1 && val2
# Not
!val1
# Logical & Comparison
(val1 == val2)||(val3 != val4)
(val1 == val2)&&(val3 != val4)
!((val1 == val2)&&(val3 != val4))
Yes, it doesn't support less than and greater than comparison, because it's only supported with string and Boolean string only. For Integer comparison use cmp function, but it's only supported in aroma-config script.​String and Escape CharactersFortunately Edify support common string sintax. It's also supported escape characters for newline. The string in Edify defined with double quoted (") and ended with double quoted. Here the basic manipulation of string in Edify:
Code:
# Newline use \n:
"Hi, AROMA Installer is\nAWSOME!!!"
# Concat multiple lines:
"Lorem Ipsum Dolore sit\n"+
"Amet, lorem ipsum dolore\n"+
"sit amet, lorem ipsum\n"+
"dolore sit amet."
# Escape Characters:
"You can add\tTabs, \" Quote, \\ Backslash…"
# Hex Characters:
"It was character A : \x41"
Not Supported Operators in EdifyThere is a lot of operator features in common programming languages that not supported by edify, like assignment operator for inserting something into variable, bitwise operator for manipulating bits within integer, and arithmetic operators for doing simple math calculations.
All this limited has been added via functions (except bitwise), but only available for aroma-config script, and only simple operations supported.​
What UI's AROMA Installer Supported
AROMA Installer had 4 main type of Customizable User Interfaces, the Wizard UI, Dialog UI, Splash UI and Installer UI. And un-customizable Menu UI for selecting About, Help, Tools and Quit Installer.​Wizard UI
The Wizard UI was the main User Interface in AROMA Installer, it's contain Back and Next button in navigation bar just like Computer common Installer programs (Windows Installer, NSIS Install System, InstallShield). Users can navigate trough the screens, or back to previous screens if something not right in configurations. Users can select Typical or Customize installations, and Users can customize what packages to install.
AROMA Installer support many Wizard UI, and here the completed list of it's UI:
checkbox – UI to show checkboxes in groupable list, the selected items will be saved in prop format, and can be accessed with file_getprop.
selectbox – It's like checkbox, but it's only able to check 1 items per group.
textbox – It will show the textbox, you can read text file to show it into the textbox
viewbox – It's like Textbox, but not scrollable, and only supported limited text length
agreebox – It's like Textbox, but with agree checkbox, user can't step to next page if the checkbox not already checked. Useful to show License or Terms of Use Interface.
menubox – This UI will show list of menu to select, there is no Next button, because when User select the item, it will automatically step into next page. And The selected menu will be saved in temporary prop file.
Dialog UIWhile Wizard UI will shown it's interface in Fullscreen, the Dialog UI will shown it's interface in Popup Window, It was useful for some needs, like show confirmation for "Are You Sure want to format the partitions?", or show Alert Dialog for "Thanks for using my ROM". Here the complete list of Dialog UI in AROMA Installer:
alert – Show popup dialog, with limited text length and Only the OK button.
confirm – Show popup dialog, with limited text length and contains 2 customizable Button "Yes" and "No", with return value true for "Yes" and false for "No".
textdialog – Show scrollable text popup dialog, with long text length support and Only OK Button.
Splash UIThis UI Simply show the Splash Screen from png files with custom delay before it show next page. The image will automatically position in center of screen depended from it's image size. The background will be blended in blur and darkest color.​Installer UIWhen configuration invoke the install UI, it will start an installation, and show the installer UI with description text on top window, textbox for installer information in middle, and progress text and bar in bottom of screen. The installation will not cancelable, and there is no buttons or menu to select before installation finished, The Next and Save Logs button will be shown after installation finished. And next Wizard UI can't do Back command beyond this installer UI, so the Installer UI will only shown once time only in flash process.​
What Functions AROMA Installer SupportedThere is so many functions that you can used for your needs, The available functions was the common functions that may be usable for installations, but not supported very complex things. AROMA Installer support simple comparison, math, system partition information, and simple set and get variables.
Here the list of functions that you can used:
setcolor – Set UI Color Scheme
ini_set – Set Aroma Configuration settings
calibrate – Calibrating Touch Screen
getvar – Get Variable
setvar – Set Variable
appendvar – Append string into variable
prependvar – Prepend string into variable
file_getprop – Get prop value of some key from prop file.
readfile – Read text file from zip content
readfile_aroma – Read text file from zip content relatively from aroma META-INF folder.
getdisksize – Get partition total size
getdiskfree – Get partition free size
getdiskusedpercent – Get partition used size in percentage
cmp – Simple integer comparison ( >, <, ==, >=, <=, != )
cal – Simple math calculator ( +, -, /, * )
iif – Inline if
if else – If and Else Statement
pleasewait – Show please wait/loading progress when calculating/doing hard process that took a lot of time.
writetmpfile – Write/create temporary file with text contents
exit – terminate installation.
Custom Fonts
You can customize your AROMA Installer Fonts. The AROMA Installer use 2 type of fonts "Big" and "Small", the Big font used in Title and the Small Font used in almost any controls. To use the custom fonts, copy the big.png or small.png into META-INF/com/google/android/aroma/fonts.
List of Custom Fonts Currently Available to Download - by amarullz
​Download Custom Fonts ( 5 Fonts ) [+]​Create Your Own Font
You can also create your own fonts, it was plain png (32 bit color depth). All letter was arranged in ASCII order Start from ASCII 32 (space) to ASCII 95 ( ~ char) then ( © - Copyright ) character.
Here the letter list:
Code:
!”#$%&’()*+,-./0123456789:;<=>[email protected] JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~©
In the first row picture, there is pixel to seperate one letter to next letter, because AROMA Installer didn't use fixed size fonts ( console fonts like courier ). The fonts will rendering from 2nd row into end of rows. Here the example:
NOTE: AROMA Installer only need alpha channel for this, the color of fonts will using the AROMA color scheme defined in aroma-config. The width separator (in first row pixel) should be full opaque (alpha=100% or 255).
If you make your own fonts, please fell free to post here...​Other Custom Fonts
You can also use third party custom fonts created by other xda-developers users. Here some custom font list:
Monospace Font - by mickey-r
Functions Reference
CONFIGURATION FUNCTIONS
setcolor
Descriptions:
Set AROMA Installer Color Scheme. It can also defined in themes with theme.prop file
Sintax:
void setcolor(colorname, hexcolor);
Parameters:
colorname - Name of color to be set. colorname with "_g" for gradient color.
winbg, winbg_g : Main/Top Most Window Backgroud
winfg : Main/Top Most Window Text Foreground
winfg_gray : Main/Top Most Window Gray Text Foreground
dialogbg, dialogbg_g : Popup Window Backgroud (Alert, Confirm, About)
dialogfg : Popup Window Text Foreground
textbg, textbg_g : Textbox, Checkbox, and any scrollable UI Background
textfg : Textbox, Checkbox, and any scrollable UI Text Foreground
textfg_gray : Gray Text ( on Optionbox/Checkbox Item Description )
controlbg, controlbg_g : Control / Button / Checkbox border - Background Color
controlfg : Button Text Color
selectbg, selectbg_g : Selected Element Background ( Pushed/focused Button/items, etc )
selectfg : Selected Element Text/Foreground Color
titlebg, titlebg_g : Window Title Background
titlefg : Window Title Text Foreground Color
navbg, navbg_g : Bottom Bar (Navigation Bar) Background. Next-Previous Area
scrollbar : Scrollbar indicator color
border, border_g : Common Border Color
progressglow : Progress Animation Color
hexcolor - Hexadecimal Color in RGB. it support 3 and 6 characters hexadecimal started with #. example: "#a8e" or "#ff5599".
Return Value: none
Examples:
Code:
# Set Color with 3 chars hexcolor
setcolor("winbg", "#444");
setcolor("winbg_g", "#222");
setcolor("textbg", "#333");
setcolor("textfg", "#fff");
# Set Color with 6 chars hexcolor
setcolor("textfg_gray", "#bbbbbb");
setcolor("controlbg", "#446699");
setcolor("controlbg_g", "#223355");
ini_set
Descriptions:
Sets the value of a AROMA Installer configuration option
Sintax:
void setcolor(configname, newvalue);
Parameters:
configname - Configuration name to be set.
roundsize : Set Corner size of rounded rectangle for common controls (default:"3")
button_roundsize: Set Corner size of rounded rectangle for button controls (default:"2")
window_roundsize : Set Corner size of rounded rectangle for main window (default:"4")
transition_frame : Set number of frames for transition (default:"5")
text_ok : Set text for common OK text (default:"OK")
text_next : Set text for wizard next button (default:"Next >")
text_back : Set text for wizard back button (default:"< Back")
text_yes : Set text for default yes button (default:"Yes")
text_no : Set text for default no button (default:"No")
text_about : Set text for About menu (default:"About & Informations")
text_calibrating : Set text for Calibration Menu (default:"Calibrating Tools")
text_quit : Set text for Quit Menu (default:"Quit Installation")
text_quit_msg : Set text for Quit Confirmation Message (default:"Are you sure to quit the Installer?")
rom_name : Set ROM Name Information
rom_version : Set ROM Version Information
rom_author : Set ROM Author Information
rom_device : Set ROM Device Information
customkeycode_up : Set Alternative keycode for up key (navigate up)
customkeycode_down : Set Alternative keycode for down key (navigate down)
customkeycode_select : Set Alternative keycode for select key (select an item)
customkeycode_back : Set Alternative keycode for back key
customkeycode_menu : Set Alternative keycode for menu key
newvalue - New value to be set for configname
Return Value: none
Examples:
Code:
# Set ROM Informations
ini_set("rom_name", "AROMA ROM");
ini_set("rom_version", "1.0");
ini_set("rom_author", "amarullz");
ini_set("rom_device", "HTC Desire (bravo)");
# Set Custom Text
ini_set("text_ok", "OK Man");
ini_set("text_next", ">>");
ini_set("text_back", "<<");
# Set Alternative Key Code - You can use keycapture tool
# to capture your device keycode
ini_set("customkeycode_up", "115");
ini_set("customkeycode_down", "114");
ini_set("customkeycode_select", "116");
ini_set("customkeycode_menu", "229");
ini_set("customkeycode_back", "158");
calibrate
Descriptions:
Set Touch Screen Calibration Data. Different device may had different touch screen calibration data. To get calibration data, press menu, select calibration tools then follow the intructions.
Sintax:
void calibrate(divx, addx, divy, addy [, alternative_method]);
Parameters:
divx - Division value for horizontal touchscreen to display resolution.
addx - Add value for horizontal alignment.
divy - Division value for vertical touchscreen to display resolution.
addy - Add value for vertical alignment.
alternative_method [Optional] - Use alternative method for touch screen handling if normal method not works in your device (default:"no")
Return Value: none
Examples:
Code:
# HTC Desire Calibrated Data
calibrate("7.90","20","7.90","20");
# Alternative method Calibrated Data
calibration("1.8447", "37", "1.2158", "27", "yes");
calibtool
Descriptions:
Start calibration tool.
Sintax:
void calibtool(dummy_arguments);
Parameters:
dummy_arguments - Edify should pass at least 1 arguments. Just Pass "" for it
Return Value: none
Examples:
Code:
# Start Calibrating Tools
calibtool("");
theme
Descriptions:
Set AROMA Installer Theme will be used in next display.
Sintax:
void theme(theme_name);
Parameters:
theme_name - Theme Name will be used. It was theme directory name located in "META-INF/com/google/android/aroma/themes"
Return Value: none
Examples:
Code:
# Use ICS Theme located at:
# META-INF/com/google/android/aroma/themes/ics
theme("ics");
VARIABLE FUNCTIONS
getvar
Descriptions:
Get Variable
Sintax:
variable_value getvar(varname);
Parameters:
varname - Variable Name
Return Value: Variable Value
Examples:
Code:
# Show "testvar" value in alert
alert(
"Value of testvar",
getvar("testvar")
);
setvar
Descriptions:
Set Variable
Sintax:
void setvar(varname, value);
Parameters:
varname - Variable Name to be set
value - New Value for Variable
Return Value: none
Examples:
Code:
# Set new value for "testvar"
setvar("testvar", "This is only test!!");
# Now Show the "testvar" value in alert
alert(
"Value of testvar",
getvar("testvar")
);
appendvar
Descriptions:
Append new value after previous value, it's like concating strings ( previous_value + newvalue )
Sintax:
void appendvar(varname, value);
Parameters:
varname - Variable Name to be set
value - New Value to be appended in variable
Return Value: none
Examples:
Code:
# Set new value for "testvar"
setvar("testvar", "This is only test!!");
# Append new value
appendvar("testvar", "Add String");
# "testvar" now will contain "This is only test!!Add String"
prependvar
Descriptions:
Prepend new value before previous value, it's like concating strings ( newvalue + previous_value )
Sintax:
void prependvar(varname, value);
Parameters:
varname - Variable Name to be set
value - New Value to be prepended in variable
Return Value: none
Examples:
Code:
# Set new value for "testvar"
setvar("testvar", "This is only test!!");
# Prepend new value
prependvar("testvar", "Add String!! ");
# "testvar" now will contain "Add String!! This is only test!!"
PROP FILE HANDLER FUNCTIONS
file_getprop
Descriptions:
Read prop file value for given keyname
Sintax:
prop_value file_getprop(filename, keyname);
Parameters:
filename - Absolute path of prop file in filesystem
keyname - Prop Key Name
Return Value: Value of prop for given keyname
Examples:
Code:
# Get value of "item.1.1" from /tmp/aroma-data/custom.prop
alert(
"Value of Prop",
file_getprop("/tmp/aroma-data/custom.prop", "item.1.1")
);
prop
Descriptions:
Same with file_getprop, but will read relatively from AROMA Temporary Directory "/tmp/aroma-data/"
Sintax:
prop_value prop(filename, keyname);
Parameters:
filename - Relative path of prop file in AROMA Temporary Directory "/tmp/aroma-data/"
keyname - Prop Key Name
Return Value: Value of prop for given keyname
Examples:
Code:
# Get value of "item.1.1" from /tmp/aroma-data/custom.prop
alert(
"Value of Prop",
prop("custom.prop", "item.1.1")
);
zipprop
Descriptions:
Same with file_getprop, but will read the prop file from Zip
Sintax:
prop_value zipprop(zip_path, keyname);
Parameters:
zip_path - Absolute path of prop file in Zip ( don't add "/" in first character )
keyname - Prop Key Name
Return Value: Value of prop for given keyname
Examples:
Code:
# Get value of "item.1.1" from META-INF/com/google/android/aroma/custom.prop
alert(
"Value of Prop",
zipprop("META-INF/com/google/android/aroma/custom.prop", "item.1.1")
);
resprop
Descriptions:
Same with zipprop, but will read the prop file from Zip relatively from AROMA Resource Directory "META-INF/com/google/android/aroma/"
Sintax:
prop_value resprop(zip_path, keyname);
Parameters:
zip_path - Relative path of prop file in Zip from AROMA Resource Directory "META-INF/com/google/android/aroma/"
keyname - Prop Key Name
Return Value: Value of prop for given keyname
Examples:
Code:
# Get value of "item.1.1" from META-INF/com/google/android/aroma/custom.prop
alert(
"Value of Prop",
resprop("custom.prop", "item.1.1")
);
sysprop, property_get
Descriptions:
Read system property value for given keyname
Sintax:
prop_value property_get(keyname);
prop_value sysprop(keyname);
Parameters:
keyname - Prop Key Name
Return Value: Value of prop for given keyname
Examples:
Code:
# Get Device Board Name
alert(
"Device Board Name",
sysprop("ro.product.board")
);
# Get Board Platform
alert(
"Device Board Name",
property_get("ro.board.platform")
);
FILESYSTEM FUNCTIONS
writetmpfile
Descriptions:
Write string into file in AROMA temporary
Sintax:
void writetmpfile(filename, value);
Parameters:
filename - Destination file in AROMA temporary directory
value - String that will be write into the file
Return Value: none
Examples:
Code:
# It will saved in from /tmp/aroma-data/test.txt
writetmpfile("test.txt", "This is test text");
# Show the content in alert with readtmpfile
alert(
"Value of test.txt",
readtmpfile("test.txt")
);
# Show the content in alert with read
alert(
"Value of test.txt",
read("/tmp/aroma-data/test.txt")
);
write
Descriptions:
Write string into file in filesystem
Sintax:
void write(filename, value);
Parameters:
filename - Absolute path to Destination file
value - String that will be write into the file
Return Value: none
Examples:
Code:
# It will saved in from /sdcard/test.txt
writetmpfile("/sdcard/test.txt", "This is test text");
# Show the content in alert with read
alert(
"Value of test.txt",
read("/sdcard/test.txt")
);
readtmpfile
Descriptions:
Read string from file in AROMA temporary directory
Sintax:
content_of_file readtmpfile(filename);
Parameters:
filename - File in AROMA temporary directory that will be readed
Return Value: Content of file in String
Examples:
Code:
# It will read data from /tmp/aroma-data/test.txt
# then save it in variable
setvar(
"testvar",
readtmpfile("test.txt")
);
read
Descriptions:
Read string from file in filesysten
Sintax:
content_of_file read(filename);
Parameters:
filename - Absolute path to Destination file that will be readed
Return Value: Content of file in String
Examples:
Code:
# It will read data from /sdcard/test.txt
# then save it in variable
setvar(
"testvar",
read("/sdcard/test.txt")
);
ZIP CONTENT HANDLING FUNCTIONS
readfile
DEPRECATED!!! - Identical with zipread. Will be deleted soon.​
readfile_aroma
DEPRECATED!!! - Identical with resread. Will be deleted soon.​
zipread
Descriptions:
Read string from file in zip
Sintax:
content_of_file zipread(zip_path);
Parameters:
zip_path - Absolute path to Destination file in zip that will be readed
Return Value: Content of file in String
Examples:
Code:
# It will read data from zip content "META-INF/com/google/android/aroma/text.txt"
# then save it in variable
setvar(
"testvar",
zipread("META-INF/com/google/android/aroma/text.txt")
);
# It will read data from zip content "tmp/text.txt"
# then save it in variable
setvar(
"testvar2",
zipread("tmp/text.txt")
);
resread
Descriptions:
Read string from file in zip relatively from AROMA Resource Directory "META-INF/com/google/android/aroma/"
Sintax:
content_of_file resread(zip_path);
Parameters:
zip_path - Relative path of file in Zip from AROMA Resource Directory "META-INF/com/google/android/aroma/" that will be readed
Return Value: Content of file in String
Examples:
Code:
# It will read data from zip content "META-INF/com/google/android/aroma/text.txt"
# then save it in variable
setvar(
"testvar",
resread("text.txt")
);
ZIP EXTRACT FUNCTIONS
ziptotmp
Descriptions:
Extract file from zip content into AROMA Temporary directory, and automatically chmod it for executable.
Sintax:
void ziptotmp(zip_path, destination_name);
Parameters:
zip_path - Absolute path to Destination file in zip that will be extracted
destination_name - Extracted target filename
Return Value: none
Examples:
Code:
# It will extract "tmp/busybox" into "/tmp/aroma-data/busybox"
ziptotmp("tmp/busybox", "busybox");
# Now we can execute it
exec("/tmp/aroma-data/busybox","ls","-l");
restotmp
Descriptions:
Extract file from zip content in AROMA Resource Directory "META-INF/com/google/android/aroma/" into AROMA Temporary directory, and automatically chmod it for executable.
Sintax:
void restotmp(zip_path, destination_name);
Parameters:
zip_path - Relative path of file in Zip from AROMA Resource Directory "META-INF/com/google/android/aroma/" that will be extracted
destination_name - Extracted target filename
Return Value: none
Examples:
Code:
# It will extract "META-INF/com/google/android/aroma/busybox" into "/tmp/aroma-data/busybox"
restotmp("busybox", "busybox");
# Now we can execute it
exec("/tmp/aroma-data/busybox","ls","-l");
EXEC FUNCTIONS
zipexec
Descriptions:
Extract file from zip into AROMA temporary, chmod it, and execute it.
Sintax:
exit_status zipexec(zip_path [, argument1, argument2, ... ]);
Parameters:
zip_path - Absolute path of zip content that will be executed
arguments [Optional] - Command line Arguments
Return Value: Return exit status. "0" for common success status
The output buffer/stdout will be automatically saved into "exec_buffer"
Examples:
Code:
# It will extract and run "META-INF/com/google/android/aroma/test.sh"
zipexec("META-INF/com/google/android/aroma/test.sh");
# With Arguments
zipexec("META-INF/com/google/android/aroma/test.sh", "argument1", "argument2");
# Get Return Status
if
zipexec("META-INF/com/google/android/aroma/test.sh") == "0"
then
alert(
"Exec Status",
"Shell was executed successfully"
);
endif;
# Get STDOUT
zipexec("META-INF/com/google/android/aroma/test.sh");
alert(
"Exec STDOUT",
getvar("exec_buffer")
);
resexec
Descriptions:
Same as zipexec, but it will extract and run the file from zip relatively from AROMA Resource Directory "META-INF/com/google/android/aroma"
Sintax:
exit_status resexec(zip_path [, argument1, argument2, ... ]);
Parameters:
zip_path - Relative path of zip content from AROMA Resource Directory "META-INF/com/google/android/aroma/" that will be executed
arguments [Optional] - Command line Arguments
Return Value: Return exit status. "0" for common success status
The output buffer/stdout will be automatically saved into "exec_buffer"
Examples:
Code:
# It will extract and run "META-INF/com/google/android/aroma/test.sh"
resexec("test.sh");
# With Arguments
resexec("test.sh", "argument1", "argument2");
# Get Return Status
if
resexec("test.sh") == "0"
then
alert(
"Exec Status",
"Shell was executed successfully"
);
endif;
# Get STDOUT
resexec("test.sh");
alert(
"Exec STDOUT",
getvar("exec_buffer")
);
run_program, exec
Descriptions:
Run executable from filesystem
Sintax:
exit_status run_program(path [, argument1, argument2, ... ]);
exit_status exec(path [, argument1, argument2, ... ]);
Parameters:
zip_path - Absolute path to executable
arguments [Optional] - Command line Arguments
Return Value: Return exit status. "0" for common success status
The output buffer/stdout will be automatically saved into "exec_buffer"
Examples:
Code:
# It will run "ls" command
run_program("/sbin/ls");
# or
exec("/sbin/ls");
# With some Arguments
run_program("/sbin/ls", "-l", "/sdcard");
# Mounting Device
exec("/sbin/mount", "-t", "auto", "/system");
# Get Return Status
if
exec("/sbin/mount", "-t", "auto", "/system") == "0"
then
alert(
"Exec Status",
"Mount was executed successfully"
);
endif;
# Get STDOUT
exec("/sbin/ls", "-l", "/sdcard/*.zip");
alert(
"List of Zip in SDCARD",
getvar("exec_buffer")
);
--- reserved ---
This deserves some mad props. I've used your installer on sebastiaan's Runnymede ROM, and it's made installing the ROM an absolutely astonishing experience to which no other install script can even compare.
Congratulations!
amarullz said:
Download
Version 1.00 - ANGGREK [2012/01/24][DOWNLOAD]
Initial Release
Customizable
Optimized Build
Signing Your Script
AROMA Installer need Signing Their script to be able to pass Installer UI.
Select your aroma-config script and updater-script script in File Input below, then click Generate Signature, to download your Installer Sign File (CERT.SA). Place it in your META-INF folder, then pack your ROM.
Why I need Sign My Installer?
I Hate someone who use other works but don't know who actually created it... But I love someone use my works without even pay anything or buy anything for me. So This method is the best way to notice all users that the AROMA Installer was created by me. If you don't like the method, I can't force you to use my works...
Sign Your AROMA Installer Scripts Now [+]​
Customizing Your Script
AROMA Installer can be configured and customized as you like, there is so many features and functions you can used to implemented many things. In this manual, we will learn all the features and functions in technical ways and can be implemented directly in configuration for practice, or production.
For Customizing Info, Please Visit My Website [+]​
Click to expand...
Click to collapse
hi
this need s-off for htc sensations?
[CHEF] TAG : Only for ROM Maker.
It was for zip ROM, so User will be able to customize their rom installation...
What about those in which the touch screen doesn't work in recovery?
Faryaab said:
What about those in which the touch screen doesn't work in recovery?
Click to expand...
Click to collapse
It still works with volume keys or trackpad/navigation... The generic CWM include Touch Driver. so It will works in almost all recoveries (ofcourse except the recovery with trimmed kernel). But the devices had different calibrating data, so ROM Chef should try to calibrate the device use "menu"->Calibrating Tools in Installer...
amarullz said:
It still works with volume keys or trackpad/navigation... The generic CWM include Touch Driver. so It will works. But the devices had different calibrating data, so ROM Chef should try to calibrate the device use "menu"->Calibrating Tools in Installer...
Click to expand...
Click to collapse
I have tried this on my Galaxy S and the touch screen doesn't work but Menu button does work but i can't select anything with any key.
Faryaab said:
I have tried this on my Galaxy S and the touch screen doesn't work but Menu button does work but i can't select anything with any key.
Click to expand...
Click to collapse
Can You navigate trough the items??
What default keys you used in recovery to select items?
Currently the selection keys was:
BTN_MOUSE, KEY_ENTER, KEY_CENTER, KEY_CAMERA, KEY_F21, KEY_SEND
Maybe I should include POWER Button to select something.
Navigation can be used with:
KEY_DOWN, KEY_UP, KEY_VOLUMEDOWN, KEY_VOLUMEUP
I will rebuild it now...
Try attached file: To Make the touch screen works, run the Calibrating Tools, then edit aroma-config file in "META-INF\com\google\android"
NOTE: Calibrating data included in the binary was for HTC Desire, to change it, check this line in aroma-config:
Code:
##
# Calibrate Touchscreen
# defaut: HTC Desire Touch Screen Calibrate Data 8,-20,8,-20
#
# For other device, run the installer, then press "menu"
# and select Calibrating Tools. Follow Instructions, and make
# sure the touch screen has been valid in the testing step.
#
# In the end, there will be alert dialog with calibration data
# ( green ), replace this calibrate() function with that data.
#
calibrate("8","-20","8","-20");
amarullz said:
Can You navigate trough the items??
What default keys you used in recovery to select items?
Currently the selection keys was:
BTN_MOUSE, KEY_ENTER, KEY_CENTER, KEY_CAMERA, KEY_F21, KEY_SEND
Maybe I should include POWER Button to select something.
Navigation can be used with:
KEY_DOWN, KEY_UP, KEY_VOLUMEDOWN, KEY_VOLUMEUP
I will rebuild it now...
Try attached file: To Make the touch screen works, run the Calibrating Tools, then edit aroma-config file in "META-INF\com\google\android"
NOTE: Calibrating data included in the binary was for HTC Desire, to change it, check this line in aroma-config:
Code:
##
# Calibrate Touchscreen
# defaut: HTC Desire Touch Screen Calibrate Data 8,-20,8,-20
#
# For other device, run the installer, then press "menu"
# and select Calibrating Tools. Follow Instructions, and make
# sure the touch screen has been valid in the testing step.
#
# In the end, there will be alert dialog with calibration data
# ( green ), replace this calibrate() function with that data.
#
calibrate("8","-20","8","-20");
Click to expand...
Click to collapse
Assign the power button to select option as we use our home and power button to select. If you assign the power button then we can calibrate our touch screen.
Faryaab said:
Assign the power button to select option as we use our home and power button to select. If you assign the power button then we can calibrate our touch screen.
Click to expand...
Click to collapse
Try This File: http://forum.xda-developers.com/attachment.php?attachmentid=870326&stc=1&d=1327419127
I Add Home + Power Button for Selecting Menu...
amarullz said:
Try This File: http://forum.xda-developers.com/attachment.php?attachmentid=870326&stc=1&d=1327419127
I Add Home + Power Button for Selecting Menu...
Click to expand...
Click to collapse
Invalid Attachment..
Faryaab said:
Invalid Attachment..
Click to expand...
Click to collapse
Damn... reupload it... in attachment
amarullz said:
Damn... reupload it... in attachment
Click to expand...
Click to collapse
Now keys are working but even after calibrating the touch screen it doesn't work.
Faryaab said:
Now keys are working but even after calibrating the touch screen it doesn't work.
Click to expand...
Click to collapse
can you move the circle in the end of calibrating?.. In alert Dialog, there is script data like this: calibrate("8","-20","8","-20");
The code should be included in aroma-cofig
##
# Calibrate Touchscreen
# defaut: HTC Desire Touch Screen Calibrate Data 8,-20,8,-20
#
# For other device, run the installer, then press "menu"
# and select Calibrating Tools. Follow Instructions, and make
# sure the touch screen has been valid in the testing step.
#
# In the end, there will be alert dialog with calibration data
# ( green ), replace this calibrate() function with that data.
#
calibrate("8","-20","8","-20");
#
#
you should unzip the file, and edit the aroma-config, then re-zip it again....

[Q]c# / development questions (background-img, checkbox)

Hi
i work on my first app, the info-part is finished. now i want add a simple question/answer-part. the first part with button for answers and questions works fine, but with the checkboxes i have some problems.
i want two or three solutions for one question, wich can be choose if i am click on one of these checkboxes. the answer is showing up in MessageBox and work so far, but the checkbox don't be cleared!?
What i have to do, to clear the checkbox. please help me! i don't know so much about the source-code c#, so every explanation will help me! Thanks!
xaml.cs
Code:
private void checkBox6_Checked(object sender, RoutedEventArgs e)
{
MessageBox.Show("Richtig!");
checkBox6.?? = checkBox6.??;
}
private void checkBox7_Checked(object sender, RoutedEventArgs e)
{
MessageBox.Show("Richtig!");
checkBox7.?? = checkBox7.??;
}
xaml
Code:
<TextBlock Height="73" HorizontalAlignment="Left" Margin="13,489,0,0" Name="DerTextblock13" VerticalAlignment="Top" TextWrapping="Wrap" Width="436" FontSize="22">Question?</TextBlock>
<CheckBox Content="YES" Height="72" HorizontalAlignment="Left" Margin="5,518,0,0" Name="checkBox6" VerticalAlignment="Top" Checked="checkBox6_Checked" />
<CheckBox Content="NO" Height="72" HorizontalAlignment="Right" Margin="0,518,18,0" Name="checkBox7" VerticalAlignment="Top" Checked="checkBox7_Checked" />
Just need to change the IsChecked property.
checkbox6.IsChecked = false;
hi
thanks for your comment.. i have read and search about "checkbox6.IsChecked = false;" and test it, but it doesn't work. i got this error in attached image.. checkbox6 is in content not available, but there is in content the checkbox6 (Name="checkbox6" and Checked="checkBox6_Checked")..
so i still don't know, why i get this error.. sorry for my stupid question..
Control names are case sensitive. It should be checkBox6.IsChecked = false;
oh man, what a stupid error.. thanks, case sensitive was the right keyword!
how can i change background-image for other xaml-site
hi
i don`t want open a new thread, so i ask here.
new problem! how can i change the background-image for an other xaml-site?
i searched a lot and find a lot, but nothing show me exactly how i can realize this.
in the source-code below, you see that i can change the background-image for example on mainpage.xaml.
Now i want integrate in my setting.xaml and settings.xaml.cs the same checkboxes to change the background-image on the mainpage.xaml.
What i have to do? Thanks for help!
xaml.cs
Code:
private void checkBox2_Checked(object sender, RoutedEventArgs e)
{
Uri uriR = new Uri("image/angler.png", UriKind.Relative);
BitmapImage imgSource = new BitmapImage(uriR);
this.imagechange.Source = imgSource;
checkBox1.IsChecked = false;
}
private void checkBox1_Checked(object sender, RoutedEventArgs e)
{
Uri uriR = new Uri("image/new-background.png", UriKind.Relative);
BitmapImage imgSource = new BitmapImage(uriR);
this.imagechange.Source = imgSource;
checkBox2.IsChecked = false;
}
xaml
Code:
<CheckBox Content="Hintergrund" Height="72" Margin="54,-33,0,0" Name="checkBox2" Checked="checkBox2_Checked" Width="163" FontSize="18" />
<CheckBox Content="Hintergrund 2" Height="72" Margin="0,-33,49,0" Name="checkBox1" Checked="checkBox1_Checked" Width="187" FontSize="18" />
Well done very good
Not sure if it's the best way, but one option would be to store the value you want to use in IsolatedStorageSettings. Then, when the page loads, it checks the value in ISS and applies that background (in its OnNavigatedTo event handler is probably best).
GoodDayToDie said:
Not sure if it's the best way, but one option would be to store the value you want to use in IsolatedStorageSettings. Then, when the page loads, it checks the value in ISS and applies that background (in its OnNavigatedTo event handler is probably best).
Click to expand...
Click to collapse
thanks, i have found a code to read an image in IsolatedStorage.. see below..
but i got a error.. i found a example-project, all works fine and i can read a image-file from IsolatedStorage. but in my app it doesn't work and i got these error..
also i had added the namespaces in xaml.cs
using System.IO.IsolatedStorage;
using System.IO;
xaml.cs
xaml-code
Code:
<Image x:Name="imagechange" Margin="30,62,38,204" Stretch="Fill" />
<Button Content="lesen" Height="72" HorizontalAlignment="Left" Margin="269,533,0,0" x:Name="lesen" VerticalAlignment="Top" Width="160" FontSize="19" Click="lesen_Click" />
vs 2010 are showing no faults in debugmodus! But if i click on button "lesen", i got the attached error. Please, where is the fault or what i have to do now?
does anyone has a idea about my described problem. sorry for my stupid questions, but that's all new for me and i want to learn it..
Do you have actual file "logo.jpg" on your ISF? Insert before opening:
if (myIsolatedStorage.FileExists("logo.jpg"))
{
... your code ...
sensboston said:
Do you have actual file "logo.jpg" on your ISF? Insert before opening:
if (myIsolatedStorage.FileExists("logo.jpg"))
{
... your code ...
Click to expand...
Click to collapse
hi
i had added your comment to source-code.. now, nothing happen, if i click on the button for reading the file from isolated storage..
how can i add the file "logo.jpg" to isolated storage?? i thought, i only have to put the file to my current project, like i did it with other images and then i can save or read the file to isolated storage.
I think this must be the fault. How can manage it? thanks..
Code:
private void lesen_Click(object sender, RoutedEventArgs e)
{
BitmapImage bi = new BitmapImage();
using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
if (myIsolatedStorage.FileExists("logo.jpg"))
using (IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile("logo.jpg", FileMode.Open, FileAccess.Read))
{
bi.SetSource(fileStream);
this.imagechange.Height = bi.PixelHeight;
this.imagechange.Width = bi.PixelWidth;
}
}
this.imagechange.Source = bi;
}
jayjojayson said:
i had added your code in comment to source-code.. now, nothing happen, if i click on the button for reading the file from isolated storage..
how can i add the file "logo.jpg" to isolated storage??
Click to expand...
Click to collapse
You may try to:
- download image from network and save to isf;
- copy from resource stream to isf;
- manually upload file to the app ISF using ISETool.exe or third-party tool.
jayjojayson said:
i thought, i only have to put the file to my current project, like i did it with other images and then i can save or read the file to isolated storage.
Click to expand...
Click to collapse
Wrong assumption.
P.S. Try this (btw, it's a first google link!): http://technodave.wordpress.com/201...ge-for-local-html-content-on-windows-phone-7/
hi
thanks a lot, it works... the first comment you have written are right..
i only have to save it first to isolated storage, before i can read the file.
thanks for your explanation to add files to ISF.. i have serach for that topic, but found nothing that describe how to added to ISF.. thanks for the link... i will read this in the evening...
now i have to find out, how i can change a image on a other site(xaml). than i can change for example in my setting.xaml the background in the mainpage.xaml
every day i learn new things, that's really exciting...
jayjojayson said:
now i have to find out, how i can change a image on a other site(xaml). than i can change for example in my setting.xaml the background in the mainpage.xaml
Click to expand...
Click to collapse
Sorry, I didn't read the whole thread before answering; seems like you are digging in the wrong direction. You don't need to use ISF (but it was a good practice for you), all you need is just a dynamical binding.
I'm too lazy to type code sample for you but (he-he!), our good friend google.com returned a good link for you http://www.eugenedotnet.com/2011/05...-property-in-silverlight-and-windows-phone-7/
P.S. Experience to use google should be "the must" in developer's experience.
entry Text in new line
Hi
i use google, my best friend, for a lot of my questions. but sometimes i don't know the right searchkeywords to do what i want to do (like image binding).
i have a new small problem. in my app i have 4 textboxes, that i use to write in some data. These 4 textboxes, i write to isolated storage in a textfile and let them summarized showing up in a textblock. This works fine.
Now, if i want write a new entry, these entry is written directly after the first entry.
example like is insert in textblock
Code:
▷Text - Text - Text - Text| ▷Text - Text - Text - Text|
But i want that the entry is written in a new line? How can i do this?
example like i want it
Code:
▷Text - Text - Text - Text|
▷Text - Text - Text - Text|
i know that i can create new lines with \n , \r\n and Environment.NewLine.
Code:
IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
//create new file
using (StreamWriter writeFile = new StreamWriter(new IsolatedStorageFileStream("fangbuch.txt", FileMode.Create, FileAccess.Write, myIsolatedStorage)))
{
string someTextData = text.Text + "▷" + datum.Text + " - " + fisch.Text + " - " + größe.Text + "cm" + " - " + gewicht.Text + "Kg" + " | " + "\r\n";
writeFile.WriteLine(someTextData);
writeFile.Close();
}
if i use one of the elements to create a new line, like is showing in code above, the new (second) entry overwrite the first entry. What can i do now? thanks for your help.
You're using FileMode.Create, which will overwrite an existing file. You need to either use FileMode.OpenOrCreate and then seek to the end of the file, or you need to use FileMode.Append (this is the preferred approach).
Additionally, the StreamWriter.WriteFile function automatically appends a newline for you. There's no need to have them manually placed at the end of your text string.
http://msdn.microsoft.com/en-us/library/system.io.filemode.aspx

[TUT] Create your First Widget Step by Step

Hi guys, as the Title implies this Tutorial is just a Beginner's Guide on Creating Widgets (Widget that displays current time) and how do they work on an Android device.
Pre-requisites :
Install the Android SDK, Eclipse and ADT Plugin (If you're using Android Studio, you can modify the project like this, shared by @creepyncrawly )
Basic Java Knowledge (Not mandatory, as Google is there for you)
Already have created basic HelloWorld apps specified here and here.
So, let's start with the Project shall we ...
Starting Development :
Step 1: Open up your Eclipse, click File > New > Other > Android Project
The project name could be given as "HelloWidget", and then select any Build Target Platform of your choice (Android 2.1/2.2/2.3/4.0 etc.), and then specify a package name.
And then, uncheck the probably already checked Box “Create Activity”. We won’t create an Activity here we just want a simple widget. Just like the below picture :
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
Step 2 : So now as you have created your Project, lets start with the Layout and design of our widget. Open up main.xml (Path:- HelloWidget > res > layout > main.xml) and modify it like as shown in the below picture :
We have a simple linear layout with a TextView for your message to display. At this point, you will get an Error saying ERROR Error: No resource found that matches the given name (at 'background' with value '@drawable/widget_bg_normal') That’s because you don’t have the widget_bg_normal resource at this point. You could download the picture I used, and you can put that picture or find your own .9.png image. Put that image (Path:- HelloWidget > res > drawable > widget_bg_normal.9.png). If you don't find a folder named drawable, just create one in that path
You'll also encounter another error suggesting that @string/widget_text can't be found. To correct that open up strings.xml (Path:- HelloWidget > res > values > strings.xml) and modify it as shown in the below picture :
Click to expand...
Click to collapse
Step 3 [Slightly big Step, don't get bored] : So, we just have finished our design part. Now we have to tell Android that we are going to have a widget. Open up AndroidManifest.xml (Path:- HelloWidget > AndroidManifest.xml) and modify it as shown in the below picture :
NOTE: minSdkVersion="15" denotes that minimum Android version required is Android 4.0.3 (API Level 15) and if you are building on Android 2.2/2.3 just leave it as default and don't edit it to 15. [In other words, it will be set default according to whatever platform versions you have downloaded]
Explanations : We declare our Broadcast Receiver which will be “HelloWidget”. Don’t forget the dot before HelloWidget, this will create the full qualified path name with the declared package at the top of the file. The Label of our application was already set by the project wizard and is located in our strings.xml.
From the Documentation, The <intent-filter> element must include an <action> element with the android:name attribute. This attribute specifies that the AppWidgetProvider accepts the ACTION_APPWIDGET_UPDATE broadcast. This is the only broadcast that you must explicitly declare. The AppWidgetManager automatically sends all other App Widget broadcasts to the AppWidgetProvider as necessary.
The meta-data tag tells android about your widget provider. In this case, the widget provider is located at HelloWidget > res > xml > hello_widget_provider.xml Create folder xml under res. Create a new XML file inside that xml folder and name it as "hello_widget_provider.xml". Create like shown in the below picture :
Now, after all these, the only thing that is missing to run our widget is the Class that extends the AppWidgetProvider which we declared in AndroidManifest.xml at the receiver-tag.
Right-Click your Project (HelloWidget) > New > Class
And create the class as shown in the below picture :
So, your new Class will look like this :
Click to expand...
Click to collapse
Step 4 : So, we have created a blank widget that actually does nothing. We'll just see for ourselves how does it looks like. Run your Application (HelloWidget > Run As > 1 Android Application) and your AVD is powered up. And voila, you should see the output as something like this as shown in the below picture :
And yes, it seems its not that crazy as we thought . Just one widget alignment mistake which could be corrected by modifying the design layout in xml, I believe.
Anyways, lets just quickly head over to the next step which would actually define the widget (The Java way)
Click to expand...
Click to collapse
Step 5 : Now, open up the HelloWidget.java (Path:- HelloWidget > src > com.coolsandie.android.widget > HelloWidget.java) file, and modify it as shown in the below picture (In order to display the Time inside the Widget, apart from displaying a default text)
I'll also give it as CODE, but I recommend not to copy-paste. Type all the codes by yourself in order to learn. Avoid writing the import statements first and directly start with class and methods. Eclipse will give a warning to import, so you can do it from there. And one more, look out for spelling mistakes, as Java is highly case sensitive language such as the letter A and a are different.
Code:
package com.coolsandie.android.widget;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.widget.RemoteViews;
public class HelloWidget extends AppWidgetProvider {
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
Timer timer = new Timer();
timer.scheduleAtFixedRate(new MyTime(context, appWidgetManager), 1, 1000);
}
private class MyTime extends TimerTask {
RemoteViews remoteViews;
AppWidgetManager appWidgetManager;
ComponentName thisWidget;
DateFormat format = SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM, Locale.getDefault());
public MyTime(Context context, AppWidgetManager appWidgetManager) {
this.appWidgetManager = appWidgetManager;
remoteViews = new RemoteViews(context.getPackageName(), R.layout.main);
thisWidget = new ComponentName(context, HelloWidget.class);
}
@Override
public void run() {
remoteViews.setTextViewText(R.id.widget_textview, "TIME = " +format.format(new Date()));
appWidgetManager.updateAppWidget(thisWidget, remoteViews);
}
}
}
Click to expand...
Click to collapse
Step 6 : So guys, we have finished it. The completely working widget should be ready by now. Run your Application (HelloWidget > Run As > 1 Android Application) and your application is synced, and it will show the output just like as shown in the below picture :
Click to expand...
Click to collapse
Finally, we have made it. It only took 6 steps for a completely working Widget.
And I hope you enjoyed this Tutorial. Its made as simple as possible, so surely anyone could give it a try.
NB: If anyone faces issues, as a last resort you can check out the Eclipse project which I've used for this Tutorial. Try importing the Project in Eclipse. Only use it, if you are really annoyed of errors. Anyways I'd recommend Trial and Error method and fixing it by your own before using mine. Download Project Source codes
FOOT-NOTE
The method onUpdate will be called at first. We create a timer that will run our MyTime-Thread every second. The constructor of the MyTime-Class gets some information to update our widget on the desktop/home screen. Get our main view that we created (at that point you could also change your layout to another design).
remoteViews = new RemoteViews(context.getPackageName(), R.layout.main);
In the run method, we set the time with our new Date and update the remote View. That’s already it. Now you have a widget that is displaying the current time.
Previous Tutorial : Extend your HelloWorld App Step by Step [Toast Concept]
Next Tutorial : How to set Icons for your Android apps
great tut buddy... so u r from cochin... me trichur ( but in dublin)
s-X-s said:
great tut buddy... so u r from cochin... me trichur ( but in dublin)
Click to expand...
Click to collapse
Thanks mate, and yes I'm from Cochin
thank you so much for these amazing and super easy tutorials!! please make a few more!!
shahrukhraza said:
thank you so much for these amazing and super easy tutorials!! please make a few more!!
Click to expand...
Click to collapse
Welcome mate, yeah sure will make more Tutorials
Hey, I am trying to follow your tutorial. But I don't understand why the error "ERROR Error: No resource found that matches the given name (at 'background' with value '@drawable/widget_bg_normal')" won't disappear. It's just like Eclipse doesn't want to accept that i have put a new folder including the picture inside the res folder. I can see both the drawble folder and the widget_bg_normal.9.png in the project explorer, but Eclipse keeps saying that no resource is found.
Edit: Hm, putting the image file inside of one of the res/drawble-Xdpi folders works. But still I don't understand why creating a new drawble folder doesn't.
elyts said:
Hey, I am trying to follow your tutorial. But I don't understand why the error "ERROR Error: No resource found that matches the given name (at 'background' with value '@drawable/widget_bg_normal')" won't disappear. It's just like Eclipse doesn't want to accept that i have put a new folder including the picture inside the res folder. I can see both the drawble folder and the widget_bg_normal.9.png in the project explorer, but Eclipse keeps saying that no resource is found.
Edit: Hm, putting the image file inside of one of the res/drawble-Xdpi folders works. But still I don't understand why creating a new drawble folder doesn't.
Click to expand...
Click to collapse
Hi, from the screenshot I see that your widget_bg_normal.9.png image is put inside the drawable folder which is inside the layout folder. That is plain false. The drawable folder should be out side the layout folder, and inside the res folder. The folder tree looks like this :
res
- drawable-hdpi
- drawable-ldpi
- drawable-mdpi
- drawable-xhdpi
- drawable
layout
- main.xml
great tutorial...thanks :good:
coolsandie said:
Hi, from the screenshot I see that your widget_bg_normal.9.png image is put inside the drawable folder which is inside the layout folder. That is plain false. The drawable folder should be out side the layout folder, and inside the res folder. The folder tree looks like this :
res
- drawable-hdpi
- drawable-ldpi
- drawable-mdpi
- drawable-xhdpi
- drawable
layout
- main.xml
Click to expand...
Click to collapse
Ok, thanks. I was pretty confused - you should change the path in your tutorial then.(Path:- HelloWidget > res > layout > drawable > widget_bg_normal.9.png)
elyts said:
Ok, thanks. I was pretty confused - you should change the path in your tutorial then.(Path:- HelloWidget > res > layout > drawable > widget_bg_normal.9.png)
Click to expand...
Click to collapse
Oops sorry, that was a mistake from my side. Corrected the OP now. Thanks for notifying.
Hehe, no problem But I have another problem. I finished Step 3 and now I want to take a look at my widget. The project doesnt show any errors and I can upload the widget to my phone. The package is on my phone but it is not shown inside my widget list. What could be the reason for this? I mean, shouldnt there be an error or something if it does not work? Did I forget something? I really dont know why I am having so much problems following simple Android tutorials...
elyts said:
Hehe, no problem But I have another problem. I finished Step 3 and now I want to take a look at my widget. The project doesnt show any errors and I can upload the widget to my phone. The package is on my phone but it is not shown inside my widget list. What could be the reason for this? I mean, shouldnt there be an error or something if it does not work? Did I forget something? I really dont know why I am having so much problems following simple Android tutorials...
Click to expand...
Click to collapse
Actually, I haven't tried this on my phone, as I simply executed it to the Emulator. Anyways select USB Debugging mode, and make sure your device is detected by the ADB. And then run your project and the widget will be installed on your phone, and when you unlock the device the widget should display on your homescreen I guess. I'll make a try and upload the screenshot of my phone, if it was successful.
coolsandie said:
Actually, I haven't tried this on my phone, as I simply executed it to the Emulator. Anyways select USB Debugging mode, and make sure your device is detected by the ADB. And then run your project and the widget will be installed on your phone, and when you unlock the device the widget should display on your homescreen I guess. I'll make a try and upload the screenshot of my phone, if it was successful.
Click to expand...
Click to collapse
That's exactly what I did. But there was nothing on my display. So I browsed the files on my phone and I can find the package with the name of my project. But I can't do anything with it. If I run the project on an AVD the same happens.
elyts said:
That's exactly what I did. But there was nothing on my display. So I browsed the files on my phone and I can find the package with the name of my project. But I can't do anything with it. If I run the project on an AVD the same happens.
Click to expand...
Click to collapse
So I just run on my phone, and it was okay, it executed.
The Steps I did was :
- My android-sdk lies in D:\android-sdk-windows
- Open Command-Prompt, and type D:\android-sdk-windows\platform-tools\adb devices
- It displayed my device, so ADB detected it.
- Open Eclipse, run your project and it will be installed on your phone.
- Then simply add the widget on your Homescreen, and also check the "Manage apps" to see whether the apk is installed.
EDIT: Check whether you get these messages in Eclipse (If executing on the device)
Code:
[2012-11-27 20:57:40 - HelloWidget] ------------------------------
[2012-11-27 20:57:40 - HelloWidget] Android Launch!
[2012-11-27 20:57:40 - HelloWidget] adb is running normally.
[2012-11-27 20:57:40 - HelloWidget] No Launcher activity found!
[2012-11-27 20:57:40 - HelloWidget] The launch will only sync the application package on the device!
[2012-11-27 20:57:40 - HelloWidget] Performing sync
[2012-11-27 20:57:40 - HelloWidget] Automatic Target Mode: using device 'xxxxxx'
[2012-11-27 20:57:40 - HelloWidget] Uploading HelloWidget.apk onto device 'xxxxxxx'
[2012-11-27 20:57:40 - HelloWidget] Installing HelloWidget.apk...
[2012-11-27 20:57:46 - HelloWidget] Success!
[2012-11-27 20:57:46 - HelloWidget] \HelloWidget\bin\HelloWidget.apk installed on device
[2012-11-27 20:57:46 - HelloWidget] Done!
EDIT2: And these messages, if running on AVD
Code:
[2012-11-27 21:29:22 - HelloWidget] ------------------------------
[2012-11-27 21:29:22 - HelloWidget] Android Launch!
[2012-11-27 21:29:22 - HelloWidget] adb is running normally.
[2012-11-27 21:29:22 - HelloWidget] No Launcher activity found!
[2012-11-27 21:29:22 - HelloWidget] The launch will only sync the application package on the device!
[2012-11-27 21:29:22 - HelloWidget] Performing sync
[2012-11-27 21:29:22 - HelloWidget] Automatic Target Mode: launching new emulator with compatible AVD 'Google'
[2012-11-27 21:29:22 - HelloWidget] Launching a new emulator with Virtual Device 'Google'
[2012-11-27 21:29:33 - HelloWidget] New emulator found: emulator-5554
[2012-11-27 21:29:33 - HelloWidget] Waiting for HOME ('android.process.acore') to be launched...
[2012-11-27 21:30:36 - HelloWidget] HOME is up on device 'emulator-5554'
[2012-11-27 21:30:36 - HelloWidget] Uploading HelloWidget.apk onto device 'emulator-5554'
[2012-11-27 21:30:36 - HelloWidget] Installing HelloWidget.apk...
[2012-11-27 21:31:35 - HelloWidget] Success!
[2012-11-27 21:31:36 - HelloWidget] \HelloWidget\bin\HelloWidget.apk installed on device
[2012-11-27 21:31:36 - HelloWidget] Done!
Most probably you'll find the widget running on your Homescreen (in Emulator). But when run on device, I had to manually set the widget on Homescreen by going into widgets section on App Drawer.
coolsandie said:
So I just run on my phone, and it was okay, it executed.
The Steps I did was :
- My android-sdk lies in D:\android-sdk-windows
- Open Command-Prompt, and type D:\android-sdk-windows\platform-tools\adb devices
- It displayed my device, so ADB detected it.
- Open Eclipse, run your project and it will be installed on your phone.
- Then simply add the widget on your Homescreen, and also check the "Manage apps" to see whether the apk is installed.
EDIT: Check whether you get these messages in Eclipse (If executing on the device)
Code:
[2012-11-27 20:57:40 - HelloWidget] ------------------------------
[2012-11-27 20:57:40 - HelloWidget] Android Launch!
[2012-11-27 20:57:40 - HelloWidget] adb is running normally.
[2012-11-27 20:57:40 - HelloWidget] No Launcher activity found!
[2012-11-27 20:57:40 - HelloWidget] The launch will only sync the application package on the device!
[2012-11-27 20:57:40 - HelloWidget] Performing sync
[2012-11-27 20:57:40 - HelloWidget] Automatic Target Mode: using device 'xxxxxx'
[2012-11-27 20:57:40 - HelloWidget] Uploading HelloWidget.apk onto device 'xxxxxxx'
[2012-11-27 20:57:40 - HelloWidget] Installing HelloWidget.apk...
[2012-11-27 20:57:46 - HelloWidget] Success!
[2012-11-27 20:57:46 - HelloWidget] \HelloWidget\bin\HelloWidget.apk installed on device
[2012-11-27 20:57:46 - HelloWidget] Done!
EDIT2: And these messages, if running on AVD
Code:
[2012-11-27 21:29:22 - HelloWidget] ------------------------------
[2012-11-27 21:29:22 - HelloWidget] Android Launch!
[2012-11-27 21:29:22 - HelloWidget] adb is running normally.
[2012-11-27 21:29:22 - HelloWidget] No Launcher activity found!
[2012-11-27 21:29:22 - HelloWidget] The launch will only sync the application package on the device!
[2012-11-27 21:29:22 - HelloWidget] Performing sync
[2012-11-27 21:29:22 - HelloWidget] Automatic Target Mode: launching new emulator with compatible AVD 'Google'
[2012-11-27 21:29:22 - HelloWidget] Launching a new emulator with Virtual Device 'Google'
[2012-11-27 21:29:33 - HelloWidget] New emulator found: emulator-5554
[2012-11-27 21:29:33 - HelloWidget] Waiting for HOME ('android.process.acore') to be launched...
[2012-11-27 21:30:36 - HelloWidget] HOME is up on device 'emulator-5554'
[2012-11-27 21:30:36 - HelloWidget] Uploading HelloWidget.apk onto device 'emulator-5554'
[2012-11-27 21:30:36 - HelloWidget] Installing HelloWidget.apk...
[2012-11-27 21:31:35 - HelloWidget] Success!
[2012-11-27 21:31:36 - HelloWidget] \HelloWidget\bin\HelloWidget.apk installed on device
[2012-11-27 21:31:36 - HelloWidget] Done!
Most probably you'll find the widget running on your Homescreen (in Emulator). But when run on device, I had to manually set the widget on Homescreen by going into widgets section on App Drawer.
Click to expand...
Click to collapse
My log looks exactly like yours. And when i check "Manage Apps" its shown there. But in the widgets tab in the app drawer there are just the standard widgets that come with android. Not the one from the tutorial.
elyts said:
My log looks exactly like yours. And when i check "Manage Apps" its shown there. But in the widgets tab in the app drawer there are just the standard widgets that come with android. Not the one from the tutorial.
Click to expand...
Click to collapse
Try uninstalling that. And then "Clean Project" in Eclipse, and then execute in emulator and see whether you see the widget in homescreen after unlocking the device, ie emulator. As the project name is "HelloWidget", you should see the name "HelloWidget" inside the Widgets tab in App Drawer. I'm not sure why its not displaying in yours. :\
coolsandie said:
Try uninstalling that. And then "Clean Project" in Eclipse, and then execute in emulator and see whether you see the widget in homescreen after unlocking the device, ie emulator. As the project name is "HelloWidget", you should see the name "HelloWidget" inside the Widgets tab in App Drawer. I'm not sure why its not displaying in yours. :\
Click to expand...
Click to collapse
I started all over again... Deleted my project and created a new one. Somehow all files like main.xml, HelloWidget.java and hello_widget_provider.xml were in the new project, although i chose a different project name. I think Eclipse was just messed up. Now everything works Thank you for the great tutorial.
elyts said:
I started all over again... Deleted my project and created a new one. Somehow all files like main.xml, HelloWidget.java and hello_widget_provider.xml were in the new project, although i chose a different project name. I think Eclipse was just messed up. Now everything works Thank you for the great tutorial.
Click to expand...
Click to collapse
Glad to know and welcome.

[PC][WINDOWS] ANDROID LOCALIZER - Translate Android App Easy

ANDROID LOCALIZER
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
NOTES:
Translating Android App Is Hard And Long Process
I Will Present You This App Which Can Help You To Do Basic Translation Progress Faster And More Accurate.
Purpose Of This App Is Basic Translation Job - For Disassembling And Assembling Android APK Files You Must Use Other Tools Like APK Tool
This App Is Originally Maded By Crew From ArtfulBits Team And All Credits Are Going To Them.
I'm Not responsible For Any Eventual Errors And Misbehaving Of Your Devices.
Big Thanks To ArtfulBits - Creator Of Android Localizer
【Software Information】
Software Name:Android Localizer
Version Information:1.5
Version Size:0.2 MB
Applicable Models / Systems:MS Windows PC - Windows Os Xp/Vista/7/8
Playstore Link:No Playstore/PC Software/Developer Website:http://www.artfulbits.com/products/free/ailocalizer.aspx
【Software】
Features
Automatic Translate (Google Translate)
Google Translate works now over JSON
Grid font become changeable
Stability improved
Remember last opened application for localization
Create new localization folder by copying "original" values
Edit values
Edit arrays
Save result in XML with original localization in comments
Create backup file of localization
Browsing in localization XML as in folders structure
Add localization key or array item
Delete XML files directly from GUI
FAQ:
Q: How auto translation works?
A: Select elements in grid which you want to translate and press "Auto translate" button on toolbar. If language on which you are working known to Google Translate service then application will start in background element by element translate selections. In any moment you can cancel that operation.
Q: After translation instead of unicode symbols I saw white boxes, what to do?
A: That often happens due to usage of fonts that does not support properly you localization symbols. To solve this open "Options" of application and change font to proper one. Application will remember your choice for future.
Q: Application fails all the time, what to do?
A: Application on fall shows message box to you and save the same information into LOG file. LOG file can be found in application folder. Please send us that LOG file and we will try to fix problem ASAP.
Q: How to create skipped elements?
A: At the current moment application does not support <skip/> tag. You should wait next release or modify sources of the project;
Q: Application searching for "notepad++.exe", but I don't have it. How to fix that?
A: You have two choices. change external editor settings or install Notepad++, First: Application has "aiLocalization.exe.config" file; In it you have to find section "ExternalEditor" and place there editor on your choice. Second: go by link Notepad++ and download it.
Q: I saw that application has customized Copyright in output XML. How to change it?
A: You have to edit application configuration file "aiLocalization.exe.config" and find in it section "Copyright".
Q: I set application folder correctly but tool does not recognize my Android project, what to do?
A: Application is searching for "AndroidManifest.xml" file in project. If application can not find it then it think that project does not belong to Android sources at all. So please check file existence.
【Update log】
1.5:
Automatic Translate (Google Translate)
Google Translate works now over JSON
Grid font become changeable
Stability improved
【Software screenshot】
【Software Download】
View attachment 2327641
Getting the following error while trying auto translate
---------------------------
Error
---------------------------
Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray
\
coolgal302006 said:
Getting the following error while trying auto translate
---------------------------
Error
---------------------------
Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray
\
Click to expand...
Click to collapse
Try To Redownload Software Aggain - Attachment Changed.
BalcanGSM said:
Try To Redownload Software Aggain - Attachment Changed.
Click to expand...
Click to collapse
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
billy_cater said:
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
Click to expand...
Click to collapse
Make Sure You Have Installed Latest Java JRE & JDK Packages Although With .Net Frameworks 3.5 & 4.5
The app is unable to show "values" folder. Only "values-xxx" is shown. An fix for this?
Also, will this going to be open source? I'm interested in this.
billy_cater said:
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
Click to expand...
Click to collapse
Same error as this guy. Have the latest software as you stated.
BalcanGSM said:
Make Sure You Have Installed Latest Java JRE & JDK Packages Although With .Net Frameworks 3.5 & 4.5
Click to expand...
Click to collapse
JRE 1.7.0.25-b17, JDK 1.7 , .NET FRAMEWORKS 4.5 win8 64bit sir
Thanks,this is the what I needed
frenzyboi said:
The app is unable to show "values" folder. Only "values-xxx" is shown. An fix for this?
Also, will this going to be open source? I'm interested in this.
Same error as this guy. Have the latest software as you stated.
Click to expand...
Click to collapse
Unfortunately I got the same error, even that I've followed OP instructions.
Hi:
I get the following error while trying to save the translated file:
Can not save file due to error: An XML comment cannot contain '--', and '-' cannot be the last character. Do you want to save file into another location?
And two buttons with yes and no. On clicking yes, I try to save it to another location, but keep getting the same error.
Thanks for your help!
billy_cater said:
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
Click to expand...
Click to collapse
Change link
http://translate.google.com/translate_a/t?client=t&sl=en&tl={1}&text={0}
with
http://translate.google.com/translate_a/t?client=j&sl=en&tl={1}&text={0}
---------- Post added at 06:32 PM ---------- Previous post was at 06:22 PM ----------
Can't save file because reader is not closed.
In MainForm.LoadDocuments() add
reader.Close();
at line 700
---------- Post added at 07:25 PM ---------- Previous post was at 06:32 PM ----------
Translation did not work on multiple sentences and didn't remove heading and trailing quotes. I've modified the code.
Code:
public static string TranslateText( string textToTranslate, string abbr )
{
string strLangPair = string.Format( "en|{0} ", abbr );
// generate google translate request
// http://translate.google.com/translate_a/t?client=j&sl=en&tl=ru&text=some%20text
string url = String.Format( "http://translate.google.com/translate_a/t?client=j&sl=en&tl={1}&text={0}",
textToTranslate, abbr );
WebClient webClient = new WebClient();
byte[] resultBin = webClient.DownloadData( url );
string charset = webClient.ResponseHeaders[ "Content-Type" ];
charset = charset.Substring( charset.LastIndexOf( '=' ) + 1 );
Encoding transmute = Encoding.GetEncoding( charset );
string result = transmute.GetString( resultBin );
// find result box and get a text
JObject item = JObject.Parse( result );
JToken token = item[ "sentences" ];
String translation = string.Empty;
foreach (JToken childToken in token)
{
string phrase = childToken["trans"].ToString();
translation += phrase.TrimStart('"').TrimEnd('"');
}
return translation;
}
Tostis said:
Change link
http://translate.google.com/translate_a/t?client=t&sl=en&tl={1}&text={0}
with
http://translate.google.com/translate_a/t?client=j&sl=en&tl={1}&text={0}
---------- Post added at 06:32 PM ---------- Previous post was at 06:22 PM ----------
Can't save file because reader is not closed.
In MainForm.LoadDocuments() add
reader.Close();
at line 700
---------- Post added at 07:25 PM ---------- Previous post was at 06:32 PM ----------
Translation did not work on multiple sentences and didn't remove heading and trailing quotes. I've modified the code.
Code:
public static string TranslateText( string textToTranslate, string abbr )
{
string strLangPair = string.Format( "en|{0} ", abbr );
// generate google translate request
// http://translate.google.com/translate_a/t?client=j&sl=en&tl=ru&text=some%20text
string url = String.Format( "http://translate.google.com/translate_a/t?client=j&sl=en&tl={1}&text={0}",
textToTranslate, abbr );
WebClient webClient = new WebClient();
byte[] resultBin = webClient.DownloadData( url );
string charset = webClient.ResponseHeaders[ "Content-Type" ];
charset = charset.Substring( charset.LastIndexOf( '=' ) + 1 );
Encoding transmute = Encoding.GetEncoding( charset );
string result = transmute.GetString( resultBin );
// find result box and get a text
JObject item = JObject.Parse( result );
JToken token = item[ "sentences" ];
String translation = string.Empty;
foreach (JToken childToken in token)
{
string phrase = childToken["trans"].ToString();
translation += phrase.TrimStart('"').TrimEnd('"');
}
return translation;
}
Click to expand...
Click to collapse
sir,where can i find that line and change as you ask i do not know how to edit exe file
billy_cater said:
sir,where can i find that line and change as you ask i do not know how to edit exe file
Click to expand...
Click to collapse
You should download sources from official site.
You need Visual Studio to edit sources and recompile the application. You can't edit exe file!
billy_cater said:
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
Click to expand...
Click to collapse
Gotten the same error, Can someone make the change and upload it again please?
Which folder have to choose from browse tab? I', confused. Its saying invalid path
I have complied and improved it a little bit
mrjoy said:
Which folder have to choose from browse tab? I', confused. Its saying invalid path
Click to expand...
Click to collapse
hi, I have introduced the modifications and another useful thing, the text path for locating the decompiled apk folder. So this way one can copy and paste the path, which normally is tedious to find by browsing.
I have tried and it translates very well, congrats to the developers!!
Hope it can be helpful
ertioct said:
hi, I have introduced the modifications and another useful thing, the text path for locating the decompiled apk folder. So this way one can copy and paste the path, which normally is tedious to find by browsing.
I have tried and it translates very well, congrats to the developers!!
Hope it can be helpful
Click to expand...
Click to collapse
It would have been nice if you also provided the modified source files for download.
Besides that, it is pretty sad that xml tags are not really preserved. For example: the tag formatted="false" is not kept.
This can be really annoying.
What kind of license does it have? Maybe i can upload modified sources on google code like site?
How to auto - translate Portuguese ? Appears only symbols
crash on some apk files
example : line
thanks bro

[DEV] AndroidCtrl.dll [7.1.46.0] (ADB/Fastboot/(apk/zip) Signer - Framework)

This (C# .NET 4.6|4.7|4.8) dll is a kind of ADB/Fastboot/(apk/zip) Signer - Framework, it provides a lot of predefined .NET functions to communicate with an Android device. It's designed to work in 1st case with any non-root device but you can also use it with any rooted device (A few functions requires root access).
License
This project is licensed under the Apache License Version 2.0.
The latest build 7.1.46.0 is currently only via FTP, GoogleDrive or Dropbox available, the DevDB has currently some upload issues!
The following (N)amespaces, (C)lasses & (I)nterfaces are currently available:
(N) ADB
(N) Binary (This is the binary/exe implementation of ADB)
(C) ADB (static Management Class for the ADBClient's)
(C) ADBClient (Implementation of IADBClient)
(C) Channel (Implementation of IChannel)
(N) Device
(N) BusyBox
(C) BusyBox
(C) Find
(C) Tar
(N) Dumpsys
(C) Battery
(C) Dumpsys
(I) IBattery
(N) Input
(I) IKeyEvent
(C) Input
(C) InputExtensions
(C) KeyEvent (Implementation of IKeyEvent)
(N) IO
(NS) Compression
(NS) BrotliSharp (Only available in .NET 4.6|4.7|4.8 - In .NET Standard >= 2.1 you have to use the native .NET implementation)
(C) ADirectoryInfo (Similar to .NET Directory/-Info)
(C) AFileInfo (Similar to .NET File/-Info)
(C) AFileStream (Similar to .NET FileStream)
(C) AFileSystemInfo (Similar to .NET FileSystemInfo, it's the abstract base for ADirectoryInfo & AFileInfo)
(C) AMountPointInfo (Similar to ADirectoryInfo & AFileInfo but only for mounts)
(C) FileSystemCache (A cache object for ADirectoryInfo & AFileInfo)
(I) IFileSystemCache (Interface for FileSystemCache)
(C) IO
(I) ITransferMessage
(C) MediaScanner (Manage the Android MediaScanner, useful after some file-transfers via ADB)
(C) Mount (Requires Root and manage the mounts)
(C) Stat (stat class for the ADB-Protocol)
(C) SyncStream (Base implementation of the ADB sync service. Utilized by AFileStream)
(C) TransferMessage
(C) UPath (Similar to .Net Path but for unix paths)
(N) Logcat
(I) ILogEntry
(C) Logcat
(C) LogEntry
(N) Manager
(C) ActivityManager
(I) IInstrumentation
(C) Instrumentation
(I) IPackage
(I) IPermission
(C) Manager
(C) Package
(C) PackageManager
(C) Permission
(N) Provider
(C) Contacts (Contacts provider)
(C) ContactsDataField
(C) ContactsEmail
(C) ContactsEvent
(C) ContactsGroup
(C) ContactsIdentity
(C) ContactsIM
(C) ContactsName
(C) ContactsNickname
(C) ContactsNote
(C) ContactsOrganization
(C) ContactsPhone
(C) ContactsPhoto
(C) ContactsPostalAddress
(C) ContactsRelation
(C) ContactsSipAddress
(C) ContactsWebsite
(I) IContactsDataField
(C) Provider
(C) Telephony (Telephony provider)
(N) Screen
(C) Framebuffer (Implementation of IFramebuffer)
(C) FramebufferInfo
(I) IFramebuffer (Interface of an RAW framebuffer)
(I) IFramebufferInfo
(I) IScreenDimension
(I) IScreenFocus
(C) Screen
(C) ScreenDimension
(C) ScreenFocus
(N) Shell
(I) IShell (Interface of an shell with in-/output abilities)
(C) Shell (Implementation of IShell)
(N) SQLite
(C) Options
(C) QueryTools
(C) SQLite3 (SQLite3 database connector)
(C) BuildProperties
(C) Daemon (Manage the daemon on the device)
(C) Device
(C) Forensics (ALFA-State)
(I) IUptime
(C) OpenRecoveryScript (Manage the OpenRecoveryScript)
(C) Phone (Start a call, dial a number, add a contact or send a sms)
(C) Su
(C) Uptime
(C) Wipe
(N) Shares
(C) Monitor (Implementation of IMonitor)
(N) Socket (This is the IP based implementation of ADB - Here is NO binary/exe required)
(C) ADB (static Management Class for the ADBClient's)
(C) ADBClient (Implementation of IADBClient)
(C) ADBSocket (IP based connector - Mimics the ADB-Server)
(C) Channel (Implementation of IChannel)
(C) ADBridge (Unified access to Binary.ADB and Socket.ADB)
(I) IADBClient (Interface for nearly all ADB commands)
(I) IChannel (Interface of an RAW data channel)
(N) Fastboot
(C) Backdoor (Some backdoor commands)
(C) Fastboot (static Management Class for the FastbootClient's)
(C) FastbootClient (Includes nearly all fastboot.exe commands)
(I) IFastbootClient (Interface for FastbootClient)
(C) Monitor (Implementation of IMonitor)
(C) OEM (Some OEM commands)
(C) Wipe
(N) ProcessModels
(C) General (Includes some predefined process models)
(I) IRealTimeBG (Interface of an background process with in-/output abilities)
(C) RealTimeBGExeV2 (Implementation of IRealTimeBG)
(N) Signer
(C) Signer (signapk.jar Interface)
(N) Tools
(C) CRC
(C) Deploy (Deploy the AAPT/ADB/Fastboot/Signer files needed by this dll)
(C) Hash
(C) Hex
(C) IMEI (Some helper to verify and rebuild a valid IMEI)
(C) ToolBox
(C) Cleanup (Delete the files/folders which were created by this dll)
(C) Config
(C) DeviceInfo (Basic device info, the return from "(Binary/Socket).ADB.Devices()" and "Fastboot.Devices()")
(I) IDeviceInfo (Interface for DeviceInfo)
(I) IMonitor (Interface for the ADB.Binary, ADB.Socket and Fastboot.Fastboot monitor)
Special
Ready-To-Go MVVM's for WPF, XAML via my AndroidCtrlUI.dll
Multi-Device compatible, you can manage unlimited devices at the same time with this dll. Each device gets it's own instance. (Thread-Safe, the dll use lock() for critical sections)
UTF8-File/Folder Transfer you can transfer files/folders with containing special chars (ü, ö, ä, €, @, à, è, etc.)
On-the-fly Device to Device copy (Binary <-> Binary | Binary <-> Socket | Socket <-> Socket)
Device-Monitor, if activated, it will check every 10 sec. ADB & Fastboot for new connected devices and call an defined callback, if something changed. So your program get's an info if an device is connected or removed.
All Android key-events as (int)enum and the ability to send them as single or stack.
Hint
You can use all ADB methods/commands via USB or W-Lan/Lan, if your Rom supports ADB via W-Lan/Lan (Settings/Developer Settings)
If you want to use all sub-classes of IADBClient with BusyBox instead of the Shell, you have to set IADBClient.UseBusyBox to true. This will tell the instance to use the BusyBox commands inside each method, if the device has BusyBox installed.
Referenced .NET assembly's
System
System.Numerics
System.XML
Used Code-analysis rules:
Basic & Advanced Microsoft-Rules for Accuracy
Microsoft-managed minimum & recommended rules
Microsoft Security Rules
About the usage, the namespaces (ADB, Fastboot, Signer) have one basic instance. For example, ADB.Instance(), Fastboot.Instance(), Signer.Instance. As you can see ADB.Instance() and Fastboot.Instance() can have a parameter. This parameter is in both cases an (string) DeviceID, an IDeviceInfo or null, if you use for example null, both classes will return it's Selected client. If you use the DeviceID or the IDeviceInfo the return is a fresh instance of the client or the already created instance. So, in any case, before you call ADB/Fastboot.Instance(). Check with ADB/Fastboot.Devices() if you have a connected device. If so, use the IDeviceInfo object to start your device instance or simply pass the serial to the Instance(). All instances which you have created on this way, will be hold inside an Dictionary<string, ADBClient>, so you can configure each device instance to it's needs and call it when ever you need it. This is also the point where i say it's multi-device and multi-thread safe. Because, if you always use ADB/Fastboot.Instance() you can't reach the wrong device. Also, all classes using lock() for critical sections, because [MethodImpl(MethodImplOptions.Synchronized)] is not longer available under .NET Standard.
If you have any wishes like new features, how-to's or something else, let me know! :cyclops:
Tested OS
Win Vista | 7 | 8 | 8.1 | 10 (32Bit/64Bit in VM-Ware)
Win 7 | 8 | 8.1 | 10 (64Bit Native)
Win XP is not longer supported by ADB! (But, if you have a old ADB binary, the dll will do it's job)
Tested Devices
Android Emulator some Versions (min. 2.x) in AVD
Android x86
HTC Sensation -/ XE (non-/rooted)
HTC One M9 (non-/rooted)
Huawei P9 Lite (VNS-L21,22,23,31,etc.) (non-/rooted)
Huawei P10 Lite (WAS-LX1A,etc.) (non-/rooted)
Samsung Galaxy 2-5 (non-/rooted)
Samsung Galaxy S Plus (non-rooted)
A few Samsung Tabs (non-/rooted)
Google Pixel 4 (Android 11) (non-/rooted)
Requirements
Android: min. 2.x
Platform: x86/x64 (Windows)
Frameworks: min. .NET 4.6 and JRE (only for the Signer)
(Installed ADB/Fastboot device driver)
Download
Mirror: XDA-DevDB (since 29.01.2019 no uploads possible)
Mirror #1: My FTP (Build archiv)
Mirror #2: GoogleDrive
Mirror #3: Dropbox
Each zip-archiv contains the AndroidCtrl.dll, its markup file AndroidCtrl.xml and the program debug database AndroidCtrl.pdb for .NET 4.6|4.7|4.8 and .NET Standard 2.1 (beta)
Examples (Updated to dll version 7.1.46.0) (Updated in the next 24 h)
Mirror: My FTP
Mirror #1: GoogleDrive
Mirror #2: Dropbox
(Contains a simple exe and its source written in C# WPF)
Source
N/A (If you want to have a look at it, send me a PM or simply decompile it.)
DO NOT MIRROR MY FILES! DO NOT COPY MY THREADS!
XDA:DevDB Information
AndroidCtrl.dll, Tool/Utility for the Android General
Contributors
k1ll3r8e, squabbi, Krystanos
Version Information
Status: Stable
Current Stable Version: 7.1.46.0
Stable Release Date: 2020-09-19
Created 2016-07-24
Last Updated 2020-09-19
How - To
0. Complete How-To
1. Getting Started (General)
2. Config & Deploy
3. Individual Call (ADB/Fastboot/Signer)
4. Start/Stop (ADB/Fastboot)
5. Reboot (ADB/Fastboot)
6. DeviceConnectionMonitor
7. Device state check
8. Send KeyEvents (ADB)
Problems & Solutions
1. Windows 8.x | 10.x
NOTE
If u use any callback functions, u have to invoke any UI-/ variable-interaction from an dispatcher like the following example:
Code:
public void Monitor(Added|Changed|Removed)EventHandler(object sender, Monitor(Added|Changed|Removed)EventArgs e)
{
App.Current.Dispatcher.Invoke((Action)delegate
{
// IDeviceInfo[] e.Devices
// Here u can interact with an UI-Element or an variable in ur program code
});
}
if u do it without dispatcher, u'll get an "Thread Exception".
More examples coming soon...
(If u need a specific example, just let me know, i'll try my best to provide one.)
Changelog
DD.MM.YYYY | (A) = Added | (C) = Changed | (D) = Deleted | (F) = Fixed | (R) = Recoded | (U) Updated
----------------------------------------------------------------------------------------------------------------------------------------------------
26.07.2020 [7.0.46.0]
(A) Some new Async overloads to the AFileInfo, AFileSystemInfo, ADirectoryInfo and AMountpointInfo.
(F) A few little bugs
01.02.2020 [6.7.46.0]
(A) ADB.IADBClient{} (The old IADB interface)
(A) ADB.Binary.ADB{} (The old ADB class - only the statics)
(A) ADB.Binary.ADBClient{} (The old ADB class - without any statics)
(A) ADB.Socket.ADB{} (The old ADB class - only the statics)
(A) ADB.Socket.ADBClient{} (The old ADB class - without any statics)
(A) ADB.Device.ADirectoryInfo{}
(A) ADB.Device.AFileInfo{}
(A) ADB.Device.AFileStream{}
(A) ADB.Device.AMountPointInfo{}
(A) ADB.Device.FileSystemCache{}
(A) ADB.Device.IFileSystemCache{}
(D) ADB.Device.Directories{}
(D) ADB.Device.Files{}
(D) ADB.Device.FileSystem{}
(D) ADB.Device.FileSystemItem{}
(D) ADB.Device.IFileSystemItem{}
And everything related to those classes... Directories has been replaced with ADirectoryInfo, Files has been replaced with AFileInfo and FileSystem has been replaced with AMountPointInfo.
31.05.2019 [6.0.46.0]
(C) The Framework Version from 4.0 to 4.6
(C) The versioning:
6 = Major
0 = Minor
46 = Framework Version (4.6)
0 = Hotfix
(A) (int) ADB.Instance().Device.Screen.GetAutoBrightness()
(A) (int) ADB.Instance().Device.Screen.GetBrightness()
(A) (ScreenBrightnessMode) ADB.Instance().Device.Screen.GetBrightnessMode()
(A) (ScreenRotation) ADB.Instance().Device.Screen.GetRotation()
(A) (ScreenRotationMode) ADB.Instance().Device.Screen.GetRotationMode()
(A) (bool) ADB.Instance().Device.Screen.SetBrightness(int brightness)
(A) (bool) ADB.Instance().Device.Screen.SetBrightnessMode(ScreenBrightnessMode mode)
(A) (bool) ADB.Instance().Device.Screen.SetRotation(ScreenRotation rotation)
(A) (bool) ADB.Instance().Device.Screen.SetRotationMode(ScreenRotationMode mode)
(D) ASDK (enum)
(C From) (ASDK) ADB.Instance().Device.GetSDK()
(C To) (int) ADB.Instance().Device. GetSDK()
10.04.2019 [0.0.5.2]
(A) A workaround for older SU binaries
Code:
// (Source ADB.Device.Su {})
///<summary>
/// Enables an (W)ork(A)round for older SU binaries, which needs the command as an single argument.
///<para/>For example, the latest SU binaries support a syntax like [su -c id -u] where older binaries need [su -c "id -u"]
///<para/>If u deactivate this workaround by enabled <see cref="IADB.UseSu"/>, <see cref="IADB.UseSu"/> gets also disabled!
///<para/>This workaround is by default disabled
///<para/>Affected Methods:
///<para/><see cref="ShellCmd(string, int)"/>, <see cref="ShellCmd(string, CancellationToken, int)"/>, <see cref="ShellCmd(string, ShellDataEventHandler, int)"/>, <see cref="ShellCmd(string, ShellDataEventHandler, CancellationToken, int)"/>
///<para/><see cref="ShellCmdHRes(string, int)"/>, <see cref="ShellCmdHRes(string, CancellationToken, int)"/>, <see cref="ShellCmdHRes(string, ShellDataEventHandler, int)"/>, <see cref="ShellCmdHRes(string, ShellDataEventHandler, CancellationToken, int)"/>
///</summary>
public bool WA_SingleArgument
(A) A fix for unresponsive interactive shells. This happened to me on Lineage on my HTC Sensation, where the device sends an "resize" request... Sending a command in this state caused the command getting cut at the 1st byte, for example, u send "id -u" the delivered command was "d -u".
(A) Added "feature" detection for Binary.ADB, now u can get the "features" of the device like: cmd, stat, stat_v2, shell, shell_v2, etc. in the "IChannel.Features".
(R) Removed the last bit of code duplication and optimized some internal logic's. For example, the "Socket.IChannel" got a speed boost from ~1.920.000 bytes during an transfer of 14.400.000 bytes.
06.03.2019 [0.0.5.1]
(C) ADB.Device structure (see 1st post)
(R) ADB.Device.Provider (Decreased the loading time of the contacts and their data)
(D) AAPT completely
Older Changes:
16.02.2019 [0.0.4.2]
(A) DNS lookup for ADB.Socket
(R) Reduced code duplication
07.02.2019 [0.0.4.1]
(F) An issue inside the ADB.Binary, the problem was that "ADB.Devices()" returned nothing, if more than one device was connected. Reason for the issue was the "(int)IChannel.ReadHexLength()" function, there i read an Int16 but it was an UInt16 which caused an overflow.
29.01.2019 [0.0.4.0]
(U) AAPT, ADB, Fastboot binaries and the required dlls to the latest version (1.0.40)
(A) ADB.ADBridge - Unified access to ADB.Binary and ADB.Socket
(A) ADB.IADB - Interface for ADB-/Socket with nearly all ADB commands
(A) ADB.IChannel - Interface of an ADB-/Socket RAW-data channel
(A) ADB.IFramebuffer - Interface for the ADB-/Socket framebuffer
(A) ADB.IShell - Interface for the ADB-/Socket Shell v1 & v2
(A) IMonitor - Interface for the ADB-/Socket and Fastboot device-monitor
(A) On-the-fly device to device copy (ADB.Binary <-> ADB.Binary | ADB.Binary <-> ADB.Socket | ADB.Socket <-> ADB.Socket)
Reordered the ADB namespace... The old layout was:
ADB - Binary based ADB
ADB.Device - Device helper
ADBSocket - Socket based ADB
The new layout is:
ADB - Main ADB
ADB.Binary - Binary based ADB
ADB.Device - Device helper
ADB.Shared - Shared helper, extensions for ADB.Binary and ADB.Socket
ADB.Socket - Socket based ADB
Implemented the framebuffer for ADB.Binary and ADB.Socket (A ready-to-go Remote-Desktop is available via my AndroidCtrlUI.dll)
09.04.2018 [0.0.3.1]
This is a complete new version!
-
I added a lot of new stuff like the "CancellationToken" overload, the "MediaScanner" class and also some fine tunes to the "Screen" class, there u can now also get the Screen dimensions. Also a lot models like the old MemDumpxxx_4xx have been removed (we are now 4 versions higher and the outputs are not longer available or have changed to much).
15.02.2018 [0.0.2.5]
(F) A problem where a NULL exception was raised during directory parsing
(F) A few UI freezes and applied a few tweaks to some logic's.
(D) Tools.Icons {}
(D) Tools.TrayNotify {}
Reason for this is the upcoming compatibility to .NET Core. BUT, the functions are not lost, i added those not .NET Core compatible calls to the AndroidCtrlUI.dll... Because the UI dll will be never migrated to .NET Core.
03.11.2017 [0.0.2.4]
Nearly full new build
-
Sadly my notes are lost, based on a data loss on my Dev Environment...
Showcase
ADB-Overlay made by me
The XDA-Thread and Download can be found here
P10 Lite Toolkit made by me
The XDA-Thread and Download can be found here
P9 Lite Toolkit made by me
The XDA-Thread and Download can be found here
HTC One Toolkit from our Member @squabbi
The XDA-Thread and Download can be found here
--
U use this dll in ur project?
Send me a PM with:
Project Name
Small image
Short description
Download link
then i'll link it here.
An interesting library, time to change Droid Manager code base to use this one ^__^
Thanks for your hard work :highfive:
Could you put an example of how to use the adb and fastboot commands?
such as adb reboot
and fastboot reboot
squabbi said:
Could you put an example of how to use the adb and fastboot commands?
such as adb reboot
and fastboot reboot
Click to expand...
Click to collapse
Yup i'll do it right now
#EDIT:
Added:
Start/Stop ADB/Fastboot
Check if ADB/Fastboot is running
Device Reboot ADB/Fastboot
Sending KeyEvents ADB
Hey another question. How would I use for example:
Code:
Fastboot.Instance().OEM.ReadCid();
I would presume there would need to be a 'string' for it to save to.
Code:
private string _cid
??
EDIT: So i deciced to try this:
Code:
MessageBox.Show("cid: " + Fastboot.Instance().OEM.ReadCid());
When I press the button it shows:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Thanks!
squabbi said:
Hey another question. How would I use for example:
Code:
Fastboot.Instance().OEM.ReadCid();
I would presume there would need to be a 'string' for it to save to.
Code:
private string _cid
??
EDIT: So i deciced to try this:
Code:
MessageBox.Show("cid: " + Fastboot.Instance().OEM.ReadCid());
When I press the button it shows:
Thanks!
Click to expand...
Click to collapse
Hey there
Methods/functions like "ReadCid()" returns a "List<string>" so u can do like:
Code:
string cid = string.Join(" ", Fastboot.Instance().OEM.ReadCid().ToArray());
// or
// The return are 3 lines, so we need to get the 2cnd
string cid = Fastboot.Instance().OEM.ReadCid()[1];
NOTE
I return there a "List<string> (the raw output)" coz i dun know if the output will be the same on each device.
In this case u have filter the right line ur self
Hope this helps
k1ll3r8e said:
Hey there
Methods/functions like "ReadCid()" returns a "List<string>" so u can do like:
Code:
string cid = string.Join(" ", Fastboot.Instance().OEM.ReadCid().ToArray());
// or
// The return are 3 lines, so we need to get the 2cnd
string cid = Fastboot.Instance().OEM.ReadCid()[1];
NOTE
I return there a "List<string> (the raw output)" coz i dun know if the output will be the same on each device.
In this case u have filter the right line ur self
Hope this helps
Click to expand...
Click to collapse
Thanks again!
It worked perfectly! Another question. I'm now using a textbox to show the output like this:
Code:
MainWindow mainWin = (MainWindow)App.Current.MainWindow;
mainWin.tBOutput.AppendText(String.Join("", "\n", Fastboot.Instance().OEM.ReadCid()[1]));
mainWin.tBOutput.ScrollToEnd();
How can I do this but in a seperate window? Like one that is seperate from the MainWindow.
Thanks! :good:
squabbi said:
Thanks again!
It worked perfectly! Another question. I'm now using a textbox to show the output like this:
Code:
MainWindow mainWin = (MainWindow)App.Current.MainWindow;
mainWin.tBOutput.AppendText(String.Join("", "\n", Fastboot.Instance().OEM.ReadCid()[1]));
mainWin.tBOutput.ScrollToEnd();
How can I do this but in a seperate window? Like one that is seperate from the MainWindow.
Thanks! :good:
Click to expand...
Click to collapse
Hey there
There are 3 and more options how u can handle this...
1. Simple "MessageBox"
Code:
MessageBox.Show(string.Join("\n", Fastboot.Instance().OEM.ReadCid().ToArray()));
2. Extra Window
XAML
Code:
<Window x:Class="Multi_Explorer.viewmodel.android.fastboottools.htc.CidDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Show CID" Height="410" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
<Grid>
<RichTextBox x:Name="TokenOutput" IsReadOnly="True" ScrollViewer.VerticalScrollBarVisibility="Auto">
<RichTextBox.Resources>
<Style TargetType="{x:Type Paragraph}">
<Setter Property="Margin" Value="0,0,0,0"/>
</Style>
</RichTextBox.Resources>
<FlowDocument>
</FlowDocument>
</RichTextBox>
</Grid>
</Window>
CS
Code:
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Documents;
namespace Multi_Explorer.viewmodel.android.fastboottools.htc
{
/// <summary>
/// Interaktionslogik für CidDialog.xaml
/// </summary>
public partial class CidDialog : Window
{
#region Instance
private static CidDialog _instance = null;
public static CidDialog Instance
{
get
{
if (_instance != null)
{
return _instance;
}
else
{
_instance = new CidDialog();
return _instance;
}
}
}
#endregion
public CidDialog()
{
InitializeComponent();
this.Closing += WindowClosing;
App.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
}
#region WindowClosing
///<summary>
/// Clean exit
///</summary>
private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
_instance = null;
}
#endregion
#region Add
public void Add(List<string> msg)
{
foreach (string tmp in msg)
{
TokenOutput.Document.Blocks.Add(new Paragraph(new Run(tmp)));
}
TokenOutput.ScrollToEnd();
}
#endregion
#region Clear
public void Clear()
{
TokenOutput.Document.Blocks.Clear();
}
#endregion
}
}
Usage
Code:
CidDialog ciddiag = CidDialog.Instance;
ciddiag.Add(Fastboot.Instance().OEM.ReadCid());
// As window
ciddiag.Show();
// As dialog window (this will freeze the complete application until it's closed)
ciddiag.ShowDialog();
3. Extra Window with ADB/Fastboot instance
XAML
Code:
<Window x:Class="Multi_Explorer.viewmodel.android.fastboottools.htc.CidDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Show CID" Height="410" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
<Grid>
<RichTextBox x:Name="TokenOutput" IsReadOnly="True" ScrollViewer.VerticalScrollBarVisibility="Auto">
<RichTextBox.Resources>
<Style TargetType="{x:Type Paragraph}">
<Setter Property="Margin" Value="0,0,0,0"/>
</Style>
</RichTextBox.Resources>
<FlowDocument>
</FlowDocument>
</RichTextBox>
</Grid>
</Window>
CS
Code:
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Documents;
using AndroidCtrl;
using AndroidCtrl.ADB;
using AndroidCtrl.Tools;
using AndroidCtrl.Fastboot;
namespace Multi_Explorer.viewmodel.android.fastboottools.htc
{
/// <summary>
/// Interaktionslogik für CidDialog.xaml
/// </summary>
public partial class CidDialog : Window
{
public CidDialog()
{
InitializeComponent();
this.Closing += WindowClosing;
App.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
// If u have a selected device this will work in all sub-windows
Add(Fastboot.Instance().OEM.ReadCid());
}
#region WindowClosing
///<summary>
/// Clean exit
///</summary>
private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
_instance = null;
}
#endregion
#region Add
public void Add(List<string> msg)
{
foreach (string tmp in msg)
{
TokenOutput.Document.Blocks.Add(new Paragraph(new Run(tmp)));
}
TokenOutput.ScrollToEnd();
}
#endregion
#region Clear
public void Clear()
{
TokenOutput.Document.Blocks.Clear();
}
#endregion
}
}
Usage
Code:
CidDialog ciddiag = CidDialog.Instance;
// Optional
// ciddiag.Add(Fastboot.Instance().OEM.ReadCid());
// As window
ciddiag.Show();
// As dialog window (this will freeze the complete application until it's closed)
ciddiag.ShowDialog();
k1ll3r8e said:
Hey there
There are 3 and more options how u can handle this...
Click to expand...
Click to collapse
Thanks for clarifying! What if i want to get the identifier code? it has multiple strings? how can i choose to show all of them?
EDIT: (More questions! )
Is it possible to use:
Code:
foreach (DataModelDevicesItem device in adbDevices)
{
App.Current.Dispatcher.Invoke((Action)delegate
{
// here goes the add command ;)
deviceselector.Items.Add(device);
});
}
foreach (DataModelDevicesItem device in fastbootDevices)
{
App.Current.Dispatcher.Invoke((Action)delegate
{
deviceselector.Items.Add(device);
});
}
to check if the device is in fastboot or adb? e.g
I press a button to flash recovery. i can have my phone in adb or fastboot and it will check to see which it is in. Then it wil lcarry out a specific command?
Hey there
squabbi said:
Thanks for clarifying! What if i want to get the identifier code? it has multiple strings? how can i choose to show all of them?
Click to expand...
Click to collapse
If u mean the HTC-Bootloader unlock code, u can use the described 2 or 3.
(Both window examples have an "foreach loop" to print out each line from the List<string> into the RichTextBox)
If u want also replace the "(bootloader) " tag u can use this line:
Code:
TokenOutput.Document.Blocks.Add(new Paragraph(new Run(tmp.Replace("(bootloader) ", ""))));
just replace it in the CS code with the one in the "foreach loop".
squabbi said:
EDIT: (More questions! )
Is it possible to use:
Code:
foreach (DataModelDevicesItem device in adbDevices)
{
App.Current.Dispatcher.Invoke((Action)delegate
{
// here goes the add command ;)
deviceselector.Items.Add(device);
});
}
foreach (DataModelDevicesItem device in fastbootDevices)
{
App.Current.Dispatcher.Invoke((Action)delegate
{
deviceselector.Items.Add(device);
});
}
to check if the device is in fastboot or adb? e.g
Click to expand...
Click to collapse
Yes, so i do it in my projects also.
squabbi said:
I press a button to flash recovery. i can have my phone in adb or fastboot and it will check to see which it is in. Then it wil lcarry out a specific command?
Click to expand...
Click to collapse
For this scenario, u need a function which checks which state have the current device serial. After u have the state ADB or Fastboot, u can call 2 different methods from my dll:
ADB
Code:
// This requires Root in any case!
ADB.Instance().Device.FlashImage(IDDevicePartition partition, string localPath, bool tmpToSD = true, int timeOut = -1);
Fastboot
Code:
Fastboot.Instance().Flash(IDDevicePartition partition, string file, int timeOut = -1);
NOTE
I will build a function which will do the work in the future, next release will include it.
#EDIT:
Release it out
Code:
AndroidCtrl.Tools.General.CheckDeviceState(string deviceID);
// return is a IDDeviceState
Hope this helps
k1ll3r8e said:
Hey there
If u mean the HTC-Bootloader unlock code, u can use the described 2 or 3.
(Both window examples have an "foreach loop" to print out each line from the List<string> into the RichTextBox)
If u want also replace the "(bootloader) " tag u can use this line:
Code:
TokenOutput.Document.Blocks.Add(new Paragraph(new Run(tmp.Replace("(bootloader) ", ""))));
just replace it in the CS code with the one in the "foreach loop".
Yes, so i do it in my projects also.
For this scenario, u need a function which checks which state have the current device serial. After u have the state ADB or Fastboot, u can call 2 different methods from my dll:
ADB
Code:
// This requires Root in any case!
ADB.Instance().Device.FlashImage(IDDevicePartition partition, string localPath, bool tmpToSD = true, int timeOut = -1);
Fastboot
Code:
Fastboot.Instance().Flash(IDDevicePartition partition, string file, int timeOut = -1);
NOTE
I will build a function which will do the work in the future, next release will include it.
#EDIT:
Release it out
Code:
AndroidCtrl.Tools.General.CheckDeviceState(string deviceID);
// return is a IDDeviceState
Hope this helps
Click to expand...
Click to collapse
Hey there!
Im using this for the output:
Code:
IDDeviceState state = General.CheckDeviceState(ADB.Instance().DeviceID);
if (state == IDDeviceState.DEVICE)
{
ADB.Instance().Reboot(IDBoot.BOOTLOADER);
CidDialog ciddiag = CidDialog.Instance;
ciddiag.Add(Fastboot.Instance().OEM.GetIdentifierToken());
ciddiag.Show();
}
else if (state == IDDeviceState.FASTBOOT)
{
CidDialog ciddiag = CidDialog.Instance;
ciddiag.Add(Fastboot.Instance().OEM.GetIdentifierToken());
ciddiag.Show();
}
When I first press the button the output window shows. When I close it and press the button again it gives me this error - even if I wait a couple of seconds.
Thanks for your help! :fingers-crossed::good:
squabbi said:
Hey there!
Im using this for the output:
Code:
IDDeviceState state = General.CheckDeviceState(ADB.Instance().DeviceID);
if (state == IDDeviceState.DEVICE)
{
ADB.Instance().Reboot(IDBoot.BOOTLOADER);
CidDialog ciddiag = CidDialog.Instance;
ciddiag.Add(Fastboot.Instance().OEM.GetIdentifierToken());
ciddiag.Show();
}
else if (state == IDDeviceState.FASTBOOT)
{
CidDialog ciddiag = CidDialog.Instance;
ciddiag.Add(Fastboot.Instance().OEM.GetIdentifierToken());
ciddiag.Show();
}
When I first press the button the output window shows. When I close it and press the button again it gives me this error - even if I wait a couple of seconds.
Thanks for your help! :fingers-crossed::good:
Click to expand...
Click to collapse
Hey there
oh yes, that is my fault
U have to add this to ur Window constructor "CidDialog(){}"
Code:
this.Closing += WindowClosing;
And this is the "WindowClosing method"
Code:
#region WindowClosing
///<summary>
/// Clean exit
///</summary>
private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
_instance = null;
}
#endregion
Explain
"CidDialog.Instance" create a new instance of the window. But on close the instance will not be set to null. So u can't open it again, coz the system think it's still open.
Hope this helps
#EDIT:
I updated the examples 2 and 3 also.
k1ll3r8e said:
Hey there
oh yes, that is my fault
U have to add this to ur Window constructor "CidDialog(){}"
Code:
this.Closing += WindowClosing;
And this is the "WindowClosing method"
Code:
#region WindowClosing
///<summary>
/// Clean exit
///</summary>
private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
_instance = null;
}
#endregion
Explain
"CidDialog.Instance" create a new instance of the window. But on close the instance will not be set to null. So u can't open it again, coz the system think it's still open.
Hope this helps
#EDIT:
I updated the examples 2 and 3 also.
Click to expand...
Click to collapse
Thanks a lot man! Time to put everything in full motion! ?
Sent from my HTC One_M8 using Tapatalk
squabbi said:
Thanks a lot man! Time to put everything in full motion! ?
Sent from my HTC One_M8 using Tapatalk
Click to expand...
Click to collapse
Np dude
Good Luck!
Hey there! I may be over looking, but where can I use the 'fastboot boot image.img' command?
Thanks!
squabbi said:
Hey there! I may be over looking, but where can I use the 'fastboot boot image.img' command?
Thanks!
Click to expand...
Click to collapse
Hey bro,
I dun implemented it sry... Next build will include it.
Upload starts tonight
Sent from my HTC Sensation using XDA Free mobile app

Categories

Resources