[Android Apps and Games] NABENDU1:
For all you app developers out there !! Sony has just introduced a new App called XAppDbg which is a tool which makes debugging an app and modifying the apps much more simpler than ever before !!

Sony’s XAppDbg tool (eXtra Application Debugging tool) lets you try out different parameters without the need to rebuild the code for every change. And it’s open source!.

As an app developer you often face the situation when you need to rebuild and rerun your application very often, in order to fine tune some parameters of it. For example, this could be padding and colours in different user interface (UI) components or parameters in a physics engine. All this is a quite panestacjing process and XAppDbg is the perfect platform to allow app developers a better and efficinet way of debugging as well as modifying their applications.

With XAppDbg, you can try out different settings and see the effects immediately in your running app, without having to rebuild the code after each new change. This way, the work to fine tune the UI is made a lot more efficient.

To demostrate it,the creator Pal Szasz, software developer at Sony. created a simple particle effect visualisation, which could be used for a game or as a decoration in a music player. It consists of a number of coloured particles that move from one end of the screen to another.

(Attached Thumbnail 1)

In the screen shot above, you can see how the particle effect looks with default settings. As you can see, this does not look very impressive – the particles reach only one third of the screen before they die, and there are too few of them.

Normally you would declare these parameters as constants, run the application, adjust the constants, rebuild and run the application and repeat these steps until you have the effect you want. With XAppDbg there is much simpler alternative, and you can get started by performing some simple steps.

How does it work?

The XAppDbg tool consists of two main parts, a server running on the phone and a client running on the computer.

The server part uses Java™ reflection to scan the code for fields and methods. It exposes the public fields, the getter and setter methods as properties and the methods taking no arguments as commands. It then creates a server socket and waits for the client to connect

When the connection is made, the server sends the list of exposed fields, properties and commands to the client. During runtime, the client sends the new values to the server, which stores them using Java reflection.

How to download and setup XAppDbg for your project

Note that XAppDbg is written in Java (J2SE), which means that it can be used in desktop Java applications as well, not only Android™ applications. Also, it can be used on Linux®, Microsoft® Windows® and Mac OS X®.

1. Download XAppDbg from the Sony GitHub.

2. Remove the final keyword from the constants in your code, so the parameters can be changed during runtime. It can be good to also move all the constants inside an inner class, so they are isolated.

3. Include the XAppDbgServer library in your project, by adding the XAppDbgServer.jar to the Java build path. For example, in Eclipse: Project Properties -> Java Build Path -> Libraries -> Add jar…

4. In the code, setup an instance of the server.

In my example, I added the following code to start the server:

// Create and start the debug server

mServer = <b>new</b> XAppDbgServer();

mServer.addModule(<b>new</b> XAppDbgPropertiesModule(Consts.<b>class</b>));

mServer.start();

The first line just creates a server instance. The XAppDbgPropertiesModule scans the fields of an object or class, and exposes all the public fields it finds. The third line starts the server, and it will be listening on port 55011. In order for this to work, the application must have the INTERNET permission.

5. Run the application you’re developing on your phone.

6. Use a USB cable to connect the phone to the computer. In order for the client application on the computer to be able to connect to the phone using TCP/IP, you need Android Debug Bridge (ADB) to forward the port. This means that the following command needs to be executed in a shell every time your device is connected to the computer via the USB cable:

$ adb forward tcp:55011 tcp:55011

7. Now when you start the client application, you just need to click on “Connect localhost”, and you’re ready:

Now you can change any of your parameters during runtime on the computer and see the effect of the change immediately on your phone, without rebuilding the application.

(Attached ThumbNail 2)

When you are satisfied with the result, just copy the values from the client back into your source code and rebuild it.

XAppDbg used in practice

(Attached ThumbNail 3)

As a first example, the developer increased the birth rate, lifetime and initial maximum vertical speed of the particles, as well as the gravity, compared to the default settings shown above. As a result, there are more particles and they fill the entire screen. Note how the client marks the changed values with a red background, to make it easier for you to know which values needs to be copied back to the source code when you’re done.

Complete credit Goes to Pál Szász SW developer at Sony

Sorry the original thread and the rightful credits belong to this thread

http://xdaforums.com/showthread.php?p=37329350

However due to the lack of activity in that thread prompted me to write the new one !! I Hope moderators would be kind enough to allow this thread !!

Link for Download

https://github.com/sonyxperiadev/XAppDbg

Read the full article on developer world

http://developer.sonymobile.com/201...-apps-with-the-open-sourced-xappdbg-tool-tool

Press the THANKS button as a token of Appreciation