[Guide] [Explained] Your first Android App - Android General

Introduction​
Hello guys and welcome to my first guide (be indulgent please haha)
In this guide I will show you how to build your first Android app, knowing java langage will be very helpful to follow up but it's not required.
In addition, we will not see a lot of Java in this introductory tutorial.
That said, if you want to go further in the development of Android applications, you will need to know Java.
In this guide we will create a very simple Android application ("Hello World!) The goal is to see basis of development.
What to expect from this guide
Setting up the development environment
A very simple example
I’ll be using Windows for this tutorial. However, there will be not much difference on another system (GNU/Linux or Mac OS X). You just need to adapt the instructions to your particular situation.

The toolbox : JDK
The toolbox : JDK​
As I said quickly in the introduction, Android applications are developed in Java. You may already have some of the tools that I will present here if you ever developed in Java. Well, so much better! It is much less work for you.
A word about Java
One characteristic of Java is portability, which means that computer programs written in the Java language must run similarly on any hardware/operating-system platform. This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to platform-specific machine code. Java bytecode instructions are analogous to machine code, but they are intended to be interpreted by a virtual machine (VM) written specifically for the host hardware. End-users commonly use some special tools installed on their own machines.
These tools are included in the JDK. In addition, the JDK contains the JRE (so also the virtual machine), which is handy.
To summarize, there has two cases:
You are a simple user of Java : you must have JRE.
You are a developer : you need the JDK tools
Frequently asked question :
Since I tried to put myself in Java, I may already have JDK installed ... How do I know if this is the case ?
We will make a very simple little test (or rather 2 ).
Start by opening a command prompt in Windows (Start -> Programs -> Accessories -> Command Prompt) or a terminal if you're on a Mac or GNU / Linux.
To know if JRE is installed, type the following command:
Code:
java -version
To know if JDK is installed, type the following command:
Code:
javac
In both cases, if the command is not recognized, is that you do not have the tool in question (JRE or JDK).
If you have only the JRE, install the JDK.
If you have nothing ... Install the JDK: p (the JRE is included anyway).
In short, now that you know where you stand with your Java environment, you can do (or not btw) the installation.
While all of these explanations were not necessarily required, it is still better to know what is installed, right ?
Installing the JDK
The installation of the JDK will be faster than his explanations, I promise
downloading
To start, go to this address.
Click the "Download JDK" button.
On the next page, accept the license agreement and click on the executable to download : jdk-7u51-windows-x64.exe in my case
installation
To start the installation, double-click the executable previously downloaded and let it guide you (or run it from a terminal).
And voilà ! Here is the first brick laid.
Next steps are installing android sdk, eclipse and ADT plugin or you can just download and install adt bundle wich provide you with :
Eclipse + ADT plugin
Android SDK Tools
Android Platform-tools
The latest Android platform
The latest Android system image for the emulator
Thanks to @FreakOde and @Chain Hacker

Specific tools for Android : Android SDK
Specific tools for Android : Android SDK​
We have just installed the JDK. So now you have the tools to develop a Java program. That said, an Android application is a particular Java program. You have the basic tools but not the specific tools to Android.
The tool you are missing is the SDKAndroid. It contains what you need, not to develop a standard Java program, but to develop an Android application.
Download the Android SDK and decompression
To download the Android SDK, go here and choose the file depending on your system.
As you can see, this file is compressed (zip for Windows and Mac or tgz for GNU / Linux). Unzip it where you want on your hard drive.
Remember exactly where you put the decompressed content. His path will be needed for the future. I recommend a safe place that will not move.​
Personally, I put the contents of the zip in : C:\Android\android-sdk-windows
Add the SDK to PATH
Frequently asked question :
Ok I do not mind ... but what's the point?
No worries, before the manipulation, let me explain what it is.
What is the PATH?
When Windows (and this is the same principle on Mac or GNU / Linux) executes a command, it will search for it in specific directories...if it is not found in these directories, it considers that it does not know it and returns an error.
These specific directories are defined in what is called an environment variable: a variable (which, by definition, contains a value) accessible by Windows, everywhere, all the time.
The environment variable in question is PATH. To see its value, type the following in the command prompt in Windows:
Code:
echo %PATH%
You get a series of directories separated by ";".
It is in each of these directories that Windows searches for commands that you ask.
For example, the java command that we used earlier, is located in the C:\Windows\System32. Well I'm sure that this directory is in your PATH.
So now, we'll need that Windows knows where the new commands of the Android SDK are.
To add it to your path, execute this command :
Code:
set PATH=%PATH%;"path to android sdk"
So in my case I should execute
Code:
set PATH=%PATH%;C:\Android\android-sdk-windows
One last step is required to install the Android SDK. Do not worry, this is the easiest.
Installing Android platforms
The last step is to install at least one version of Android platform. According to the version of Android, APIs differ a little. At the time of this writing, the latest version of Android is version 4.4.2 (KitKat).
In the SDK directory, an executable is present: SDK Manager.exe. It's a small interface to manage versions of Android.
Run it to start the installation.
Among the available packages, choose the one you want:
{
"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"
}
Personally, I took everything! To be sure not to return.
On Mac and GNU/Linux, run from a terminal the "android" command in the directory / tools /.
The installation will take a few minutes (to me it was quite long since I took everything ...).
Once installation is complete, we can move to: Installing Eclipse.

Development environment : Eclipse
Development environment : Eclipse​As for the JDK, it may be that you already have Eclipse installed. If this is the case, great. You can now move on to the next section.
Otherwise, we will install it together.
Frequently asked question :
But in fact, what is Eclipse?
Eclipse is what we call an IDE or "Integrated Development Environment". This is a software that allows you to write programs more easily than simple Notepad in Windows (although it is possible). Besides the color code, it will bring you useful tools to compile your programs, debugging, etc.. It can be used to develop with any type of language, but we use it to make Java.
In addition, Eclipse is designed to be augmented with plug-ins. Thus, there is a plugin to develop Android applications ...! We'll see this in the next section.
Do you like it? Well let's go for the download and installation!
Download
First of all, go here and download Eclipse.
Choose 32 Bit or 64 Bit depending on your configuration (if you do not know , take 32 Bit ) .
On the next page , click on the big green arrow and ... wait for it to finish!
Installing Eclipse
Installing Eclipse really comes down to ... unzip the downloaded file!
You can place it anywhere on your hard drive. Personally ( on Windows ), the story that things are organized , I placed the folder " eclipse" in C:\Program Files ( or C :\Program depending on your version of Windows).
To start Eclipse, run the executable found in the directory "eclipse" (really , you guessed ? haha ) .
At startup, Eclipse will ask you the location of your Workspace. This is the directory that contains all the data related to your Java programs ( and thus your Android applications). Your source code will be stored there. This is the time , if you have a hard drive dedicated to your data, choose a directory therein. Otherwise, you can leave the default directory.
Well. Now , to develop our Android apps more easily , we need a small plugin.

A small plugin for Eclipse ADT
A small plugin for Eclipse ADT​
As I briefly mentioned in the previous section, Eclipse has been designed to be able to receive plugins. Depending on whether you are Java, PHP, Javascript developer, (...) you have at your disposal a whole bunch of plugins that make your life easier.
The plugin for the Android application development is called ADT (Android development tools).
This time we will not download the plugin on the website of his publisher but directly from Eclipse.
ADT installation:
So first start Eclipse. In the "Help" menu, select "Install New Software ...".
In the window that opens, click on "Add ..."
Enter the following values​​:
Name: Android Plugin (for example)
Location: https://dl-ssl.google.com/android/eclipse/
Click OK, and wait a few seconds. Then you get this window:
http://img15.hostingpics.net/pics/156355window.jpg
Check the "Developer Tools" (which also tick the underlying tools) and click "Next". In the next window, click again on "Next"
In the next window, accept the terms of the license agreements and click "Finish"
During installation, you may get a security warning.
It tells you that Eclipse does not know what you are installing. But we, we know. So you can safely confirm by clicking "Ok".
At the end of the installation, you are prompted to restart Eclipse.
We have one small thing to do before moving on to the next part: Configure the ADT plugin. We will tell the plugin where the Android SDK.
In the "Window" menu, select "Preferences".
In the left pane, choose "Android"
Click "Browse ..." and choose the location of the SDK installed earlier in this tutorial.
Click "Apply" then "Ok". And voila!

Setting a virtual device (for testing)​
To test our application, we use a virtual phone! Very convenient because it's cheap (well it's free )
Our virtual phone (yes you can have more than one if you want) are called "AVD", which leans "Android Virtual Device". It fits with what you want to do.
To begin, click on the little button as shown in the screenshot
This opens the AVD Manager. You should have no AVD yet. To create one, click "New ...". The following window is very important because it will define your "phone":
Configuring AVD could be a complete tutorial ... We therefore remain there for the moment.
Click the "Create AVD" button to complete the creation of your virtual mobile. You then end up with a beautiful AVD in your list. You can then close the "AVD Manager" to finally move to developing your first Android app

New Android project​
Finally! We reach the goal! Now it's good, our environment is in place. If you have not had any problems so far, you are ready to create a new Android project.
Create a new project
To begin, select from the menu "File" -> "New" -> "Project". With the ADT plugin, you now have the option to create a "Android Application Project". Select this option and click "Next". Then you come to the window, which allows you to initialize your Android project:
Here are the important information to fill :
Application name: This time it is the name of your application. That will appear in the very eyes of the user. You can put special characters if you wish.
Project Name : This is the name that will define your Eclipse project. You can put whatever you want but avoid spaces and other special characters.
Package name: By convention, the name of a package is in the form of a "url upside down ." You can put your personal domain name or whatever you want. As long as you do not post your application on a large scale , it is not very important.
Minimum required SDK: This is the minimum number required API to run your application. You can not install the application on a mobile with an older API.
Build Target : Select the version of Android on which you want to work .
Click "Finish" to create your project.
Application code
Code créé par défaut
Here is the code created by default:
Code:
package com.test.helloxda_university;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
This code contains various elements:
Package Name
some "import" android.*** : Required libraries to the script
The class MainActivity that inherits from Activity.
I will not detail what constitutes the onCreate() method because we will now change it.
Code of our "Hello XDA-University!"
The purpose of our application is to say "Hello XDA-university". For this, we need a field "text". On Android, a field of this type is a TextView (Android, all the elements are based on the View class).
We create our TextView with the following line:
Code:
TextView tv = new TextView(this);
This requires to import the corresponding library:
Code:
import android.widget.TextView;
we apply a text to our TextView:
Code:
tv.setText("Hello XDA-university !");
Finally, we apply the TextView to the current view:
Code:
setContentView(tv);
You will notice the following line:
Code:
super.onCreate(savedInstanceState);
It can tell Android how to start the application (we call the onCreate method of the parent class by passing the savedInstanceState, which is the previous state of the application).
Complete code (what a code!) of our application:
Code:
package com.test.helloxda_university;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello XDA-university !");
setContentView(tv);
}
}
With this, our text should be able to be displayed without issues.
Launch the application in the AVD
To launch the application, choose "Run" from the menu ... "Run"
The AVD will then take a few moments to start: you will see the letters "ANDROID" in gray on black background. This might take some time depending on your configuration.
Once the AVD is fully started, your application will launch automatically:
Ta daaaa!
Well I told you: nothing transcendent ... But we must start somewhere.
We arrive at the end of this tutorial dedicated to the establishment of an environment of Android development. This is not the only way.
There are many steps to finally not much except a little "Hello!" ... But you are now armed to get started with Android. I leave it to you to learn the art of developing Android applications: Sights, Activities, Intents, etc. ....
I hope you learned something with me and if you have any questions do not hesitate to ask me.

this is a great writeup. Thank you!

wfarid said:
this is a great writeup. Thank you!
Click to expand...
Click to collapse
You are welcome mate

subscribed for now. I might need this later. TQ

This is something great you have done dear..:good::good: Great tut BTW..:angel:

Probably u could have just told them to download "android bundle" from developer site..that could have saved a lot of their work

Cool..!
Sent from my Nexus 5 using XDA Premium 4 mobile app

great guide!
Just a suggestion: I think You can also avoid the virtual device's setup for testing because eclipse let You also to test the apps directly on the smartphone if You have usb debugging enabled ... it's quicker for me because a virtual device requires memory to run ..

Awesome TUT
Subscribing it might need it in future!!

Yhank You !

Dude a suggestion don't get angry you can just link to the ADT bundle instead of downloading SDK and Eclipse separately... By the way nice guide for starters.. :good: But you could have also included using XML stuff and not just the coding.. Just a suggestion.. After all they also need XML to master developing...

Amazing!!! I just start learning Java for a couple week now but now I can learn Android dev at the same time too. :good:

Hi...! Congratulations! Its an excelent guide. Im not a developer but reading the lines makes me want to learn more. If you ever want it to be translated just let me know. Salutes from Argentina!
Enviado desde mi Moto X mediante Tapatalk

Finally someone makes a guide using proper english!
Google has all this explained on the android website but it is as if they dont know english and wrote it all from a translator without the grammer!
So thank you! But a tad bit to late, i did all this a year ago (took me a few weeks)

Related

[Q] Running a C++ binary

So this is probably a silly question.
I have this rather complicated app that would be a heck of a lot of work to convert to Java.
It runs in the command line and works fine in Linux.
Trying to run it fails, but x86 bytecode probably isn't very ARM friendly.
Is there a specific way I need to compile the application?
Is it even possible to run it from a console emulator?
Thanks.
Try Android NDK
I am also new to Android Dev ( 15+ years Linux, 10+ years Java, etc.)
I am not an expert but for your purposes you need the "Android NDK" in addition to the "Android SDK" that most developers utilize.
"The Android NDK is a toolset that lets you embed components that make use of native code in your Android applications.
Android applications run in the Dalvik virtual machine. The NDK allows you to implement parts of your applications using native-code languages such as C and C++. "
Basically the tools are needed to cross compile C++ source code for the target ARM environment.
I am prevented from posting the download URL for some bizarre reason, but it is listed under "Native Development Tools" on the left side of the web page for the standard "Android SDK" download.
Yeah that's because you are new. It's a system to prevent spammers from posting URLs.
When you have a couple of posts the restriction will disappear
Anyway; found it, seems to be what I'm looking for.
I'll check it out in the morning.
Big thanks
Dmitry Moskalchukhas written a patch for the ndk to better support c++ see crytax dot net there are posts on google groups android-ndk talking about it
Thxs for the info. I was aware that the NDK did not include all of the libs that desktop Linux/UNIX developers expect. The suggested patched version adds the STL libs back in.
Sent from my PC36100 using XDA App
There are A LOT of libraries missing
I guess I'll just keep it a hosted app.
Thanks for all the input

On board android development

Im a fairly knowledgeable computer user without a computer!
I love to write programs!
It really is a shame that there is not an onboard development kit for this platform.
I have tried several implementations available in the market. None of them seem to satisfy my thirst.
Before I gave up on sl 4 a, I learned a little about android virtual machine. When coupled with the right tools, and knowledge, full access to the android java api are possible.
Being that I don't have a computer, I cannot compile any wrappers to handle superclassing the api. As you may know a simple hello world gui will not run on android without a superclass.
It is not my aim to go for full fledged on board development. The overhead is way too high. Ie battery power, syntactical semantics storage space for libraries yada yada yada...
Mozilla has the rhino javascript engine which can execute code within the android virtual machine. However as I said before super classing presents a very serious problem.
I aim to write a bridge in java and javascript. However I have no tools to do the java side work.
I do have access to a shell account with a working j d k, but the j d k is not fully compatible with the android sdk. On top of that I'm faced with the 50 megabytes quota offered with my free shell account. The android sdk is 2.5 gigabytes in size approximately.
To sum it all up there are a few files that I need from the android sdk that will allow me to compile java programs using my free shell, and then convert them for usage on the android virtual machine.
The files in question are as follows:
aapt - weird android packaging mechanism
dx - android virtual machine byte code converter.
From my research I have learned that dx is actually a java program that runs in the standard java implementation.
Well whatever the case is I need these programs running on an Ix86 Unix bsd architecture if anyone out there can supply them pre assembled.
This is not an official request for comments but all comments are appreciated.
Sent from my HTC Magic using Tapatalk
This is how I run my scripts from the shell.
Rhino came to me from sl4a. Sl4a project is unsuccessful @ functional implementation of rhino JavaScript for android at time of this writing.
For whatever purpose sl4a does not execute the dalvik command properly ($BOOTCLASSPATH is being pushed out of context via Rhino or the dalvikvm onLoad) so even though you can install the JavaScript interpreter from sl4a you can't use it without some fancy footwork.
I had to change permissions on my dalvik cache folders as well to get it working on my droid. For some reason the system did not want to accept the rhino library into its dex cache (using cyanogen mod. 6). Just do rwx permissions for everyone on
/data/cache
and
/system/cache
Note that the above file systems are usually mounted read only.
Note also that this is a single line shell command. put it in an sl4a shell script or run it from the terminal.
/system/bin/dalvikvm -Xbootclasspath:/system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/mnt/sdcard/com.googlecode.rhinoforandroid/extras/rhino/rhino1_7R2-dex.jar -Xss128k org.mozilla.javascript.tools.shell.Main -O -1
Running this command in the terminal will activate a javascript interpreter shell that has full access to the android java framework.
If you would like to run a script instead of an interactive shell please append the following to the preceding command
-f /path/to/your/script/yourscriptName.js
That line would make an interesting argument to your new shell script!
For more information about Rhino see my next post for suggestions and resources.
if you are interested in this project now is a very good time to learn java programming! I just started yesterday and I haven't been to sleep yet! lol. it is also considered a requirement to learn the android java api if you plan to capitalize on its functionality.
Aye.. time for more coffee ..
- Posted via mobile
SL4A - http://code.google.com/p/android-scripting/
Android API - http://developer.android.com/reference/packages.html
Rhino API - http://www.mozilla.org/rhino/apidocs/index-all.html
Rhino Documentation - http://www.mozilla.org/rhino/doc.html
Suggested Reading
JavaScript The Definitive Guide: 5th
Edition
some books on Java ... classes,
interfaces, overrides, packages,
sub classing, super classing,
inheritance, extends, import
// its pretty much like jascript without
// all that stuff
some books on Android Programming
- Posted via mobile
Avid Droidery said:
To sum it all up there are a few files that I need from the android sdk that will allow me to compile java programs using my free shell, and then convert them for usage on the android virtual machine.
The files in question are as follows:
aapt - weird android packaging mechanism
dx - android virtual machine byte code converter.
Click to expand...
Click to collapse
So no one out there develops for android under linux?
I downloaded the source tree for the davlik virtual machine but there is no make file to compile the project! Tell me that is not aggravating!
The web quotes a file "envsetup.sh" and a command called "lunch" to be run in a 'build' directory. None of these files were supplied with the download. Practices in idiocy should be banned from the web! Lol.
So let's say I used 'git' to grab the source tree of a single project in the android sdk. How am I supposed to build a project with no make file???
The normal way to do this... is to run the gui setup called 'android.' that does me no good. I only have ssh access to my build server!
Is there no 1 out there who can build these files for linux and supply them to me? From what I understand all you need to do is successfully install and configure the sdk and these files will b available to you in the tools directory.
I would like to file an issue about having no text based setup for the android sdk. In the real world we may not always be able to use a graphical user interface. especially under linux/unix/posix! But what good would that do me? I needed these files 3 days ago
*update issue filed under general build questions google groups (PC WIZ)
So let's recap.. if you are using the android sdk under linux or if you have physical access to a unix machine and some spare time I could really use your help!!!!
I would like to make this topic become a reality soon.
- Posted via mobile (as always)
Ok I got dx up and running.
I found where to get the files prebuilt.
http://android.git.kernel.org/?p=pl...11c17b4f5507f00905ec73f2fb90eaa387f72;hb=HEAD
Yes in platform/prebuilt .. @ the android source code repository.
I also downloaded aapt but the library files are not available on my system for this build. I don't have the rights to upgrade my development server. Stay tuned.
Here is stderr output from './aapt':
./aapt: /usr/lib/libz.so.1: no version information available (required by ./aapt)
./aapt: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.4' not found (required by ./aapt)
If you are thinking of downloading any files from the source code repository using your android device you will be very disappointed! wget fails to download the raw views of the files and reports them as garbage. The built in download manager just keeps tellin me download unsuccessful. In short it took me the better part of 3 hours to get 3 files using 3 different downloaders.
I was unable to download the shell script 'dx' nor was I able to cut copy paste the full source because android would not let me everything it did let me copy had line terminators removed. Somebody needs to fix that clipboard!! Tell me that's not aggravating!
In retrospect the browser should not say 'select text' as a menu option. It should say 'select some of this text, mangle it and then send it to the clipboard' lol.
Anonymous ftp access should be an open source requirement! I blame today's shortcomings on all open source licenses! Lmfao.
- Posted via mobile
Anyone out there care to donate a 19th/Early 20th century laptop?
I am starting to think like a rhino. I can tell because I'm ready to run my head through the wall! @ aggravating factors.
I am beginning to believe that the android platform is cursed! Lol.
The android devices are awesome! I don't really mean to offend anyone but the software is ****. The source code tree doesn't even resemble a tree.
No offense to Linus Torvalds But you shoulda stuck to hardware programming. I would like to show you a picture of what a git managed project looks like to me.
{
"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"
}
I don't know anything technical about it but I think you missed a paper or two on derivative theory. I dont know calculus but everyone knows that a seed from a tree makes a new tree. In retrospect, common sense is pure logic dressed up by the mind as a perception of reality.
My perception of your project and the issue of fault may be wrong but this monstrosity is hosted on your site (android.git.kernel.org)
Please don't get me wrong sir linux is the best damn thing running and everyone involved in its development owes that to you.
I really wish the android platform would have stuck with the tried and true GNU development system. Where source code (seeds) can be downloaded as a seperate package and module dependencies (earth, water, sun, etc..) are easily solved.
I predict this platform will fail within the next 10 years because of this build system. It is quite simply too complicated for new programmers to get on board with fresh ideas. Not to mention the amount of prior knowledge and lofty resources it requires to do so. This is a systemic issue. The flow of integration and information is invaluable to software development. I'm here to tell you the **** doesn't flow.
If anyone dares to challenge these points of authority, might you consider telling me why an open source platform with open source software does not have a bona fide linux distribution like Gentoo, damn small linux, or micro linux? I assure you it is not because no one would use it.
- Posted via mobile
Here is a great program if your'e interested in this script business.
http://code.google.com/p/android-scripting/downloads/detail?name=textedit-sl4a.apk&can=2&q=
Let's face it when it comes to the android appearing to multitask things properly it's all about the app! The dialogs are weak but the functionality is perfect. Happy scripting!
- Posted via mobile
Avid Droidery said:
Here is a great program if your'e interested in this script business.
http://code.google.com/p/android-scripting/downloads/detail?name=textedit-sl4a.apk&can=2&q=
Let's face it when it comes to the android appearing to multitask things properly it's all about the app! The dialogs are weak but the functionality is perfect. Happy scripting!
- Posted via mobile
Click to expand...
Click to collapse
Thx ill check it out
Sent from my HTC Knight using telepathy
JKILO said:
Sent from my HTC Knight using telepathy
Click to expand...
Click to collapse
That is even funnier than the guy I saw run into a car on his bicycle today! Luckily for everyone involved he wasn't hurt. Not so sure about his phone though.
You are welcome.
- Posted via mobile
Update. This project is on pause until further notice. I have been thwarted at every attempt to succeed in this endeavor therefore is my understanding that I must retool and upgrade my resources before I am able to provide a definite solution.
Feel free to ask any questions regarding my current research.
Standing by ...
- Posted via mobile
I managed to wrestle my old workstation out of storage.
Some stats
Pentium D 975 Dual Core 3.0 GHz. EM64T
4GB Ram
175 GB HITACHI SATA Gen II HD on Intel RAID Controller
FOXCONN 975X7AB MOBO
I built it back in '07 but she still runs like a champ!
Anyway just wanted to gloat a little... If you were stuck working on an android you might be as happy about your situation! Heck, I'd be happier with a knock off Chinese netbook running Windows CE 5.0. @ 255 MHz.
I predict this platform will fail within the next 10 years because of this build system. It is quite simply too complicated for new programmers to get on board with fresh ideas. Not to mention the amount of prior knowledge and lofty resources it requires to do so. This is a systemic issue. The flow of integration and information is invaluable to software development. I'm here to tell you the **** doesn't flow.
Click to expand...
Click to collapse
So what does flow? It isn't the Android API! Let's compare some code on the topic of User Interface Design and Implementation.
An application with a single button the android way:
Code:
public class MyActivity extends Activity {
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.content_layout_id);
final Button button = (Button) findViewById(R.id.button_id);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
}
});
}
}
Oh wait a second were not done yet! The following code belongs in a separate file:
Code:
// .... some of this document was removed to improve clarity.
<Button
android:id="button_id"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/self_destruct"
android:onClick="selfDestruct" />
Seriously all that for one f*%#&n button? It doesn't even do anything when you push it..
Ok that's uh... hmm interesting to say the least. :barf:
Let's look at the same thing in HTML+JS:
Code:
<FORM>
<INPUT TYPE="button" NAME="button" Value="Push Me" onClick="alert('I am not a killer, but don't push me!');">
</FORM>
Simpleton you say? Try this on for size:
Code:
;---------- [Create the Button Control] ----------
INVOKE CreateWindowEx, 0, addr ButtonClass, addr szButText,\
WS_CHILD or WS_VISIBLE or BS_PUSHBUTTON or BS_ICON or \
BS_LEFT or BS_VCENTER or BS_TEXT,\
100, 50, 100, 40, hWnd, 702, hInstance, 0
mov hButCtrl, eax
;---------- [Load the Image] ----------
invoke LoadIcon, hInstance, 901
mov hImage, eax
invoke SendMessage, hButCtrl, BM_SETIMAGE, IMAGE_ICON, hImage
The code above is actually just a snippet from a source file for a 32-Bit Program for Windows written in assembler. But the concept is the same. There is no code here for a click action. To make the example more interesting, this button has an icon drawn onto it.
Sure, I could provide more examples in different languages, but I believe my point is clear here.
Am I the only person here who realizes somebody screwed up when they thought of the API for this platform? I don't understand the reasoning behind this. The programmer spends more time implementing than creating under this platform. When I look at the more complicated apps that are available in the market I have to say well done! But I also have to say "I am sorry about your losses."
Honestly I don't know what to say other than "I wish I was head of R&D for Google over in Mountain View Ca." These guys obviously have no idea what they are doing.
Point and case made by example.
Who wants to collab. with me on an all HTML based GUI framework for the android? Honestly I would love to. Google says this platform is all about code reuse... Hmm... how come there is no /usr/lib directory? You can use their platform to make libraries! but they are for private use only unless you write a 12 chapter book (in code) explaining to the android what people can do with it. Of course then you have to write a real 12 chapter book for the developers on how to use the API you exposed. :barf: :barf: :barf:
Anyway to make matters worse... It is actually easier to program their platform using javascript, but in my honest opinion... It isn't worth the [bad language] trouble... Here's another code excerpt for android in JavaScript:
Code:
// a plethora of code removed to improve clarity....
var buttonRun = new Button(Activity);
buttonRun.setLayoutParams(new LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1));
buttonRun.setText(Droid.translate("RUN"));
buttonRun.setOnClickListener(function () {
// code to do some stuff here
});
// even more code removed to improve clarity...
If you are used to reading my posts you will have to excuse my malformed paragraphing. I am used to composing all my posts by voice recognition
So what does all this mean? In regard to the thread topic, this means that you have your work cut out for you. Just look at the JavaScript code above and see how ridiculously close it is to writing a program that must be compiled. Mind you that is only the code to create ONE button. Looking back even further, it was easier in ASSEMBLER.
Ok, Android Scripting. Its more than a great Idea... It's the best Idea anyone ever created for this platform. Its too bad that an entire platform API has to be written nearly from scratch before we can take full use of it. Well, I am working on an implementation of rhino. Everything compiles smoothly from eclipse but I can't really test anything or come up with any ideas because I know I'm headed down the wrong path.
Well I brought you here for your interest so let me boost your interest.
You want GUI programming in script? Visit the following link and click on:
http://droidscript.blogspot.com/2010/03/droidscript-getting-started.html
I wonder why that project 'died' in its infancy He certainly accomplished quite a bit!
LOL I was right about this platform before I ever opened the IDE! LOL
One more point of interest...
Assembler is the fastest (and most powerful) programming language on the planet. I never thought I would live to see the day that I would find another language (other than C++) that was harder to program with. I was wrong. And I will be wrong about this platform coming to a failure if google pulls its head out of its ass (and gives me or my ideas a job.) LOL.
Note to google devs: Keep It Simple Stupid. HTML5 Based Interface is the only way to go. Especially for a device with limited capabilities. The code is already out there and implemented. It only needs to be adapted. Seriously, throw backwards compatibility out the window and work with something that has the roots, credibility, and global support to be worthy of said term.
Anybody who wants to run that bull**** will have to settle for an 'OnBoard Legacy Code Emulator.' Personally I don't have the time to be bothered with your crypto-pseudo-bloatware and neither does my microprocessor. And just in case you are wondering, I am usually the person who has to say: "I told you so."
I have always thought of it to be like you have revealed it to us... Snap, this just means the end of my Android programmer life... so long Androooiid, so long Google !
Re: onboard android programming
I use JavaIDEdroid program with DroidDevelop for compile my android programs on my android device.
I can't paste links here, but you can find its on the market.
They use eclipse Java compiler and some another utilities to provide ability to create correctly working apk files at output.
wow. this is the only posting mentioning DroidDevelop.

Google API for Java

I'm relatively new to programming and am currently learning Java.
Google provides their API in Java for their various products. I downloaded it, followed the instructions to use ANT to get it all ready to go, but I'm stuck on how to actually start using it. I can't get their libraries to import into my programs using the JVM compiler. It just says a bunch of, "that package doesn't exist", and things of that nature. I can't even get Google's sample code to load any of the API packages.
How does one actually use the API once it's all extracted and in the C:\Program Files\Java\gdata folder? Can I not use the JVM compiler? I had to use ANT to set it all up... does that mean I have to somehow use ANT to use the API? I'm a little confused.
If somebody could write up a step-by-step on how to start using the API, that would be so awesome.
thesecondsfade said:
I'm relatively new to programming and am currently learning Java.
Google provides their API in Java for their various products. I downloaded it, followed the instructions to use ANT to get it all ready to go, but I'm stuck on how to actually start using it. I can't get their libraries to import into my programs using the JVM compiler. It just says a bunch of, "that package doesn't exist", and things of that nature. I can't even get Google's sample code to load any of the API packages.
How does one actually use the API once it's all extracted and in the C:\Program Files\Java\gdata folder? Can I not use the JVM compiler? I had to use ANT to set it all up... does that mean I have to somehow use ANT to use the API? I'm a little confused.
If somebody could write up a step-by-step on how to start using the API, that would be so awesome.
Click to expand...
Click to collapse
Judging from your post, you seem to be referring to the GData APIs. It's worth noting that Google is pushing Google APIs Client Library for Java for all new Google JSON APIs.
These APIs + samples are built with Maven2 and are pretty easy to setup.
Also judging from your post, you might want to get up to speed with basic java stuff like project setup in your IDE (Eclipse / IntelliJ ?), Build tools (Maven / ANT). Learn those things first before getting into the Google APIs. Go to the maven site and see how you can build a simple project. See how to import that project in Eclipse, and checkout the Maven plugin for Eclipse.
Most of the samples for Google APIs Client Library for Java (ex: The Books API Sample) provide step by step instructions on how to get things up and running (starting with checking out the code from the google versioning control to building it and running the sample on your environment).
Hijacking this threat a bit, but I'm also learning about APIs, Facebook and Twitter in particular.
With regard to android and java, I've done the tutorial for logging into facebook and posting basic status update but don't really understand the code; which parts are the API?
Really appreciate it if you could point me to another thread or site that explains how to use the API. I'm stuck on how to create a method that does event creation for facebook.
Thanks in advance!

[Tool][Java] Bytecode Viewer - 2.9.0 - APK/Java Reverse Engineering Suite

Bytecode Viewer is an Advanced Lightweight Java Bytecode Viewer, GUI APK Decompiler, GUI DEX Decompiler, GUI Procyon Java Decompiler, GUI CFR Java Decompiler, GUI FernFlower Java Decompiler, GUI Jar-Jar, Hex Viewer, Code Searcher, Debugger and more.
It's written completely in Java, and it's open sourced. It's currently being maintained and developed by Konloch.
There is also a plugin system that will allow you to interact with the loaded classfiles, for example you can write a String deobfuscator, a malicious code searcher, or something else you can think of.
You can either use one of the pre-written plugins, or write your own. It supports groovy, python and ruby scripting. Once a plugin is activated, it will execute the plugin with a ClassNode ArrayList of every single class loaded in BCV, this allows the user to handle it completely using ASM 3.3.
Key Features:
APK/DEX Support - Using Dex2Jar and Jar2Dex it's able to load and save APKs with ease!
Java Decompiler - It utilizes FernFlower, Procyon and CFR for decompilation.
Bytecode Decompiler - A modified version of CFIDE's.
Hex Viewer - Powered by JHexPane.
Each Decompiler/Viewer is toggleable, you can also select what will display on each pane.
Fully Featured Search System - Search through strings, functions, variables and more!
A Plugin System With Built In Plugins - (Show All Strings, Malicious Code Scanner, String Decrypters, etc)
Fully Featured Scripting System That Supports Groovy, Python And Ruby.
EZ-Inject - Graphically insert hooks and debugging code, invoke main and start the program.
Recent Files & Recent Plugins.
And more! Give it a try for yourself!
Code from various projects has been used, including but not limited to:
J-RET by WaterWolf
JHexPane by Sam Koivu
RSynaxPane by Robert Futrell
Commons IO by Apache
ASM by OW2
FernFlower by Stiver
Procyon by Mstrobel
CFR by Lee Benfield
CFIDE by Bibl
Contributors:
Konloch
Bibl
Fluke
Righteous
sahitya-pavurala
priav03
Afffsdd
Website: https://bytecodeviewer.com
Source Code: https://github.com/konloch/bytecode-viewer
Bin/Archive: https://github.com/konloch/bytecode-viewer/releases
Java Docs: https://the.bytecode.club/docs/bytecode-viewer/
License (Copyleft): https://raw.githubusercontent.com/Konloch/bytecode-viewer/master/LICENSE
Report Bugs (or below): https://github.com/Konloch/bytecode-viewer/issues
__________________________________________________________________________
Thanks for the hardwork, Will try it out...
Congrats!!
A "must-have" tool for sure... Thanks for your hard work!!!
Thanks! If any of you have any questions, or have a suggestion just reply here and I'll answer asap.
2.6.0 is out now! The biggest feature is smali editing. You can download it here https://github.com/Konloch/bytecode-viewer/releases/tag/v2.6.0
2.9.0 is released, contains LOTS of improvements for android APKs! If you've tried BCV in the past I urge you to try it again, you'll love the updates.
Konloch said:
2.9.0 is released, contains LOTS of improvements for android APKs! If you've tried BCV in the past I urge you to try it again, you'll love the updates.
Click to expand...
Click to collapse
I tried the v2.9.2 today, but was unable to make it work properly.
Used OpenJDK/JRE 7, 8, 9 on a ubuntu 14.04 with no success.
I get a blank window - I can open a file with control + o, but each time the app gives a message about not finding the temporary file which is supposed to be created (but isn't) in /home/user/.Bytecode-Viewer/bcv_temp/
I don't have any spaces in my path.
I see dex2jar running on the apk, but nothing gets created in the bcv_temp
I tried with different apks with no success.
I can decompile my apk just fine with jadx & apktool.
adwinp said:
I tried the v2.9.2 today, but was unable to make it work properly.
Used OpenJDK/JRE 7, 8, 9 on a ubuntu 14.04 with no success.
I get a blank window - I can open a file with control + o, but each time the app gives a message about not finding the temporary file which is supposed to be created (but isn't) in /home/user/.Bytecode-Viewer/bcv_temp/
I don't have any spaces in my path.
I see dex2jar running on the apk, but nothing gets created in the bcv_temp
I tried with different apks with no success.
I can decompile my apk just fine with jadx & apktool.
Click to expand...
Click to collapse
would you be able to add kalenkinloch on Skype to help me debug this issue more?
Bytecode Viewer on Android?!
Looks like an amazing tool!
Any chance it could be released as an Apk to run directly on Android devices?
Not having a PC and so using Show Java (com.njlabs.showjava) and AIDE (com.aide.ui).
Would be most interested to add Bytecode Viewer to my tool case!
Thank you!
Is there a quick start guide of sorts for this? Recompiling .java files seems promising as I am trying to disinfect a custom lockscreen APK to no avail.
And would it be possible for this to interface with the Android Studio/SDK, especially in case you're more comfortable with editing .java sources instead of having to decipher lines upon lines of bytecode?

Android - Web Automation Bot Creator

I create ScrapperMin a Bot Creator for Windows and Android (Can compile your script into APK)
Download in Play Store : ScrapperMin in Play Store
Documentation : ScrapperMin
Whats for?
1. Auto Login/Auto Posting/Auto Scraping/Auto Download File/Auto Upload File (All you need is to write a script for your task)
2. Automate your daily task or your clients task, just write a script compile to APK and give it to them, or even uploaded to play store
Pro
1. Easy to learn C like language with lots of ready made method for doing communication with website using HTTP Protocol, String Operations such as search between two words (TagMatch), File Operations.
2. Can Compile your script into APK and distribute it in Play Store complete with keystore generated for your keep safe
3. Can Run the script inside the App for testing and later deploy it as APK
4. Have documentation of what Libraries it has offer (see the website)
5. Have Windows and Android version where your script can be run in both platform (most features are compatible, some has not been implemented in Android version like OAuth libraries)
6. Any website accept HTTP protocol can be automated not only just the one offering API.
7. ITS FREE!!
Cons
1. You need to have basic programming skill
2. You need to know what parameter the website you want to automate accept, use Fiddler or browser (F12 developer console) or similar software to capture the package and analyze the input/output
Learn scrappermin syntax is easy, read the docs here : PDF Guide

Categories

Resources