How to test Bluetooth Chat Application on Froyo in VM VirtualBox

To Test Android Application “BluetoothChat” that is provided on

http://developer.android.com/resources/samples/BluetoothChat/index.html

we cannot use Android Emulator as it does not support Bluetooth.
Instead using Android Emulator I used Froyo OS, as it supports Bluetooth in Virtual Machine.

1. install VM VirtualBox in Ubuntu.
2. install the image from http://www.android-x86.org/ into a virtual machine,
3. find out it’s IP address, connect manually using adb connect

4. adb connect 192.168.1.5 // To Connect with VM, replace 192.168.1.5 with your VM IP.

5. Now click here to download changed “BluetoothChat” Project with required packages.
6. Run eclipse and import “BluetoothChat” project.
7. Launch your project from Eclipse from Run configuration.
8. From Android running device choose your target device VM.

You have done.

Note:
1. Changes were made to remove Insecure RFCOMM and ActionBar from the project.
As APIs for Creating Insecure RFCOMM is available only from API Level 10 (Android 2.3.3) and
ActionBar API is available only from Android 3.0 or API Level 11.

2. After downloading BluetoothChat.zip.doc file remove .doc extension, to get zip file.

How to post source code in wordpress

Example 1: Java
[sourcecode language="java"]

public class Hello
{
	public static void main(String[] args)
	{
		System.out.println("Hello World!");
	}
}

[/sourcecode]

It will looks like

Example 1: Java


public class Hello
{
	public static void main(String[] args)
	{
		System.out.println("Hello World!");
	}
}

Example 2: C

[sourcecode language="C"]

public class Hello
{
	public static void main(String[] args)
	{
		System.out.println("Hello World!");
	}
}

[/sourcecode]

It will looks like

Example 2: C


#include<stdio.h>
#inlcude<conio.h>

void main(void)
{
        clrscr();
        prinft("Hello");
}

C# 4.0 IN A NUTSHELL

To download  C# 4.0 IN A NUTSHELL click here

Professional Android Application Development

To download  Professional Android Application Development click here

How to add App in Android as Basic App

Application Name: PermissionManager

How to add: Following are the steps to add PermissionManager application to Android as basic app.
i.    Copy PermissionManager to /mydroid/packages/apps/ folder.
ii.    Create Android.mk file inside PermissionManager directory.

                    Android.mk    looks like

.                    LOCAL_PATH := $(call my-dir)
.                    include $(CLEAR_VARS)
.                    LOCAL_STATIC_JAVA_LIBRARIES := libarity
.                    LOCAL_SRC_FILES := $(call all-java-files-under, src)
.                    LOCAL_PACKAGE_NAME := PermissionManager
.                    include $(BUILD_PACKAGE)

iii.     Edit /mydroid/build/target/product/generic.mk to add line for   \PermissionManager

                    generic.mk looks like

.                    PRODUCT_PACKAGES := \
.                    AccountAndSyncSettings \
.                    AlarmClock \
.                    PermissionManager \

.                    ……..

.                    ……..
.                    SyncProvider
.                    $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
.                    # Overrides
.                    PRODUCT_BRAND := generic
.                    PRODUCT_DEVICE := generic
.                    PRODUCT_NAME := generic

iv.    Now Compiled source code

v.     After compilation is completed you will see PermissionManager installed.

Flashing Android Dev Phone With Modified Source Code

Flashing your Android Dev Phone with a Factory System Image click here

Flashing Android Dev Phone With Modified Source Code, follow steps given below.

1.      Download the recovery image, use it in case of recovering from a disaster.
Recovery Image:signed-dream_devphone_userdebug-ota-14721.zip from here
2.      Copy signed-dream_devphone_userdebug-ota-14721.zip to source directory.
3.      Go to ‘/source/vendor/htc/dream’  and run ‘./extract-files.sh’, or  ./unzip-files.sh
4.      Go to source directory and apply the following commands
5.      $ build/envsetup.sh
6.      $ lunch aosp_dream_us-eng
7.      Compile the modified Android Source Code for the device
8.      $ make –j
9.      Go to out/target/product/dream-open/
10.    Check these images boot.img, recovery.img, system.img and userdata.img
11.    Connect the device to your development machine over USB.
12.    Reboot device, put it into FASTBOOT mode
13.    For FASTBOOT mode, Power on the device with BACK key pressed


14.    It should show the droids on skateboard with fastboot text displayed.

15.    Make sure the cable with the device is connected.
16.    If you are flashing your device using the fastboot method, you need the command-line tool called fastboot.
17.    The fastboot source code is available in the Android open source repository and is compiled whenever you build from that tree. If you’ve built from the Android open source tree, you will find the fastboot executable in this location:  <build-dir>/out/host/<platform>/bin/
18.    Set path to fastboot and apply the following commands
19.    $ fastboot devices
20.    The above command will show you the fastboot devices.
21.    HT94JLZ00002    fastboot
22.    Now apply the following command.
23.    fastboot -p dream-open -w flashall
24.    flashall will apply all the above listed img files one by one. We can also do that manually by specifying image files names one by one. The flashing will start and our device will be loaded with our own modified source code. At completion the device will be rebooted automatically.

SERG Objective

Security Engineering Research Group specializes in security and service oriented architectures. Our areas of focus are remote attestation via Trusted Computing standards on mobile platforms. We, at Security Engineering Research Group, share knowledge that we gain through research and implementation of new and innovative research ideas.

Follow

Get every new post delivered to your Inbox.