Blue Talk


Hi friends,

Get it on Google PlayOct 2011, I started my career with android, and it is been one and half years. For Last one year, it is been a dream for me to open developer account in GOOGLE PLAY. But days passed in search/in learning for new idea, concept and bla bla. Now, I can't control my interest to enter into Google Play as a developer, so I planned to publish something. I went through my pass-time work in android; I had code, which I wrote to transfer text in Bluetooth. Of-course, this is school days program. But my interest asked me to give a touch to it and released it in the Google Play. So, I did the same...

BLUE TALK

"Wanna talk in classroom? Wanna chat in meeting hall? Or Wanna share the secret?
Let us help you now @ any place (@ close range).
One easy and smart way to talk, when you can't talk.
Keep talking... keep enjoying..."

This is how I have started my first app in Google play.



It is a basic Bluetooth chat app to communicate with a friend at short range. It will search the discoverable devices in the short range. It will show the list of devices, from which we can select and communicate.

There is Limitation/Requirement in it since it is half done. It supports only when the app in foreground and one-to-one connection only. Give me some time; I'm trying to remove the limitation and requirement in it.

Now this work is motivating to do more and taught me to create a real time work. Hope, your support will also be there :).

Special thanks to Dipta Pandit help me in designing work...
Get it on Google PlayThanks to my friends for supporting me...
Thanks to Eclipse and Google...


Android - CTS.

Hi Friends,

Our project running android along with Windows is grown up (Running Dual OS in parallel). The time is rushing to release it to the world, but we have to get the license for it to release it in the Android eco-system.  The first thing comes into the play in getting the license is CTS. Fortunately, I got the chance to study and run CTS in our project. Now, here is what I understood and doing in CTS...

 Android Compatibility Program 

The Android Compatibility Program defines the technical details of Android platform and provides tools used by OEMs to ensure that developers' apps run on a variety of devices. The Android SDK provides built-in tools that Developers use to clearly state the device features their apps require. And Google Play shows apps only to those devices that can properly run them.

An "Android compatible device” is the one that can run any application written by third-party developers using the Android SDK and NDK. Google use this as a filter to separate devices that can participate in the Android app ecosystem, and those that cannot. Devices that are properly compatible can seek approval to use the Android trademark. Devices that are not compatible are merely derived from the Android source code and may not participate in the Android app ecosystem.

In other words, compatibility is a prerequisite to participate in the Android apps ecosystem. Anyone is accepted to use the Android source code, but if the device isn't compatible, it's not considered part of the Android ecosystem.

Devices that are Android compatible may seek to license the Google Play client software. This allows them to become part of the Android app ecosystem, by allowing users to download developers' apps from a catalogue shared by all compatible devices. This option isn't available to devices that aren't compatible.

Now, for our project to become part of Android Eco-system and to use Google client software like Google play, maps, etc. we need to pass CTS test.

BUILDING CTS

Android Source tree has the source for cts, we just need to build it to use it.

“make cts” will build the cts and the output will be available in the path “android/out/host/linux-x86/cts”.

RUNNING CTS IN WINDOWS

Copy the android-cts folder from the output path to windows and run the following command in the command prompt.

set SDK_ROOT=C:\Users\AMI\AppData\Local\Android\android-sdk

java -Xmx512M -cp C:\Users\alagappanr\Desktop\android-cts\tools\cts-tradefed.jar;C:\Users\alagappanr\Desktop\android-cts\tools\hosttestlib.jar;C:\Users\alagappanr\Desktop\android-cts\tools\ddmlib-prebuilt.jar;C:\Users\alagappanr\Desktop\android-cts\tools\tradefed-prebuilt.jar -DCTS_ROOT=C:\Users\alagappanr\Desktop\ com.android.cts.tradefed.command.CtsConsole

Change the SDK and CTS path accordingly before running above lines.

Once you start the cts, it will provide the cts prompt “cts-tf >”.

NOTE: Device should be connected via adb throughout the test.

CTS COMMANDS

Few important commands are,

·         “help” and “help all” will show the commands and its usage.
·         “exit” will exit the cts prompt.
·         “run cts” command
run cts --plan test_plan_name: run a test plan.
eg. run cts –plan Android : to run android test plan.
run cts --package/-p : run a CTS test package
eg. run cts –p android.net : to run android.net package.
run cts --class/-c [--method/-m] : run a specific test class and/ormethod
run cts --continue-session session_ID: run all not executed tests from a previous CTS session
eg. run cts –continue-session 5 : to continue session 5 unexecuted cases.

Rest of the command signature and usage are shown once you run help command.

CTS Result

Test result will available in the folder “android-cts\repository\results”.

To view the test result, Open the testResult.xml generated in the folder “android-cts\repository\results\date_time”.

So, What you are waiting for... send the result to google, get the license and get google client software & service for your device and release your product in the market... :) 

Yep it is easy to say the last two lines.. But difficult to implement...

Signal in LINUX

Hi friends,

Currently, I'm working in wake-up issue in my project. I wanna inform android when my host OS windows wakes up. My project leader gave me an idea to send a signal from windows to android in the shell and use that signal to wake android when windows wakes up, like in exam days I keep alarm by 4am, my bad wakes up and give me a kick ;). But I'm zero at LINUX signal concept, as usual i studied it. Now, I'm typing here for my future ref. and other beginner's use.

SIGNAL IN LINUX

Now, we use CTRL + C to terminate something in LINUX. But, we don't wanna let someone to terminate our code with CTRL + C. So, what we have to do now. We have to monitor the user input and we should not let the system to perform any operation when user gives CTRL +C.

But, Instead what we can do in LINUX is, CTRL + C will generate a signal SIGINT in LINUX, so we can register a function to this signal in our code. So that when we user press CTRL + C, it will call our function, so our code won't be terminated.

What is signal in LINUX ? 
 LINUX has a set of signals. One nice example is, kill -9 PID, which we use to kill a process. Here, we are sending KILL signal to a process. Similarly, few other signals are available in LINUX. (SRY, i don't know to explain it, pls ask prof.google :( )

How can we register a function to a signal ?
here is the syntax,

signal(SIGINT, sig_handler)
SIGINT - signal generated on pressing CTRL + C. It can be any LINUX signal.
sig_handler - our function, which will be executed on receiving SIGINT signal.

What should be the sig_handler signature? 
here it is,
void sig_handler(int signo) {}
signo - signal number crossponding to the register signal.
Inside the function, we can write our own story.

Ok, How the final code will be? 
here is the simple one,
#include <stdio.h>
#include
<signal.h>
#include <unistd.h>

void sig_handler(int signo)
{
  if (signo == SIGINT)
    printf("received SIGINT\n");
}

int main(void)
{
  if (signal(SIGINT, sig_handler) == SIG_ERR)
  printf("\ncan't catch SIGINT\n");
  // A long long wait so that we can easily issue a signal to this process
  while(1)
    sleep(1);
  return 0;
}

Now, run the code and press CTRL + C. It will print "^Creceived SIGINT".

But, LINUX has alot of signals, is it possible to do for all signal of LINUX?
 Expect SIGKILL and SIGSTOP, we can use any signal in the place of SIGINT. So, change signal you would like register, change the body of sig_handler function as you like. Your coding will be done.

In my case, I have to generate a signal on my own... I choose to send user signal(SIGUSR1)...
So, the code will be?
here it is,

#include <stdio.h>
#include
<signal.h>
#include <unistd.h>

void sig_handler(int signo)
{
  if (signo == SIGUSR1)
    printf("received SIGUSR1\n");
}

int main(void)
{
  if (signal(SIGUSR1, sig_handler) == SIG_ERR)
  printf("\ncan't catch SIGUSR1\n");
  // A long long wait so that we can easily issue a signal to this process
  while(1)
    sleep(1);
  return 0;
}

Thats all, compile and run it :)... But how to send user signal? The following line will do that...
KILL -USR1 PID
 Got the signal!!!....

Newer Posts Older Posts Home

About Me

My photo
Hi everyone,myself Alagappan...electronic and communication engg. student... living in madurai... interested in everything... want to achieve something great in my lifetime...

Followers


Recent Comments