I am developing an android app that one of the requirements is to sending lot of commands to BLE(cc2541).

I am looking for any examples of how one would interrupt with this sensor.

I need an example to create a communication via bluetooth for my app android. I developed all prelimary operations (enable bluetooth, find device and list view where I put devices). Now, I need to establish a client communication (bytes) with one of device that I found. Thanks

I starting intent service in onCreate() method in subclass of Application class. But it is called when app is opened the first time. It should not calling on every time the app is opened. It does even not work when I kill the background process. And my observation its working in galaxy note but not in samsung s duos, please help me.

I'm developing an android app with android wear support.

In this app, I have a Service running on start and keep sending notification updates(with the same notification id) every 5 seconds to inform user of updated info and expects user reaction by adding action with RemoteInput so that user reacts with voice input.

The problem is, since the notification updates every 5 seconds, it is possible that during the voice input on the wear side, another notification has been fired and makes the current PendingIntent invalid, thus the user voice input will be not taken to the running Service to get processed.

If I put the updates interval to 20 seconds or even longer and do the voice input immediately after the updates on the wear side, then I can get the voice input on the Service side.

Because I'm developing a real time app that needs to inform user of updated info in real time, the notification updates interval should be not longer than 5 seconds...

I've also tried to set PendingIntent with different flag options but that didn't help.

Any suggestions will be appreciated.


for example i will give a sample source code of Amazon.com site and this is my html rules.

<div id="result_25" class="fstRowGrid prod celwidget" name="B00IVPU786">
    <div class="image imageContainer">
        <a href="http://rads.stackoverflow.com/amzn/click/B00IVPU786"><div class="imageBox">
    <img onload="viewCompleteImageLoaded(this, new Date().getTime(), 24, false);" src="http://ecx.images-amazon.com/images/I/41SmukivM1L._AA160_.jpg"  class="productImage cfMarker" alt="Product Details" />

<span class="lrg bold">Samsung Electronics 32GB EVO Micro SDHC with Adapter Upto 48MB/s Class 10 Memory Card (MB-MP32DA/AM)</span></a> </h3><ul class="rsltGridList grey">

i used the below code to get the data

Elements e = d.select("div[id=result_25]");

String firstURL = e.select("a").attr("href");
String secondURL = e.select("img").attr("src");

this is how i got two URL from this. But i want this "Samsung Electronics 32GB EVO Micro SDHC with Adapter Upto 48MB/s Class 10 Memory Card (MB-MP32DA/AM)" which is coming under span when i used String name = e.select("span").attr(null); i am getting error and when i used String name = e.select("span").attr(class); i am getting class name bld lrg as output. how can i do this.

I'm trying to align three views inside a RelativeLayout in such way that all three views are aligned center vertically. Then, I would like view "A" to be aligned to the left inside the RelativeLayout, view "C" to the right, and view "B" in between "A" and "C". The XML declaration looks like this:


        ... />

        ... />

        ... />


This works perfectly fine on Android 4.2.2 and above, but not below (SDK 16). It seems android:layout_centerInParent overrides android:layout_alignParentLeft/android:layout_alignParentRight, as both "A" and "C" appear right in the middle of the layout, instead of aligned to the left and right respectively. Is there a way to set the vertical alignment using a different way inside a RelativeLayout?

Is it possible to activate or deactivate the wifi on a device without prompting for the users permission using cordova/phonegap?. I searched through numerous results but they all either prompt to turn on wifi or just show the status.

when I click on button then an animation goes to left to right and right to left only for menu section layout and according to this animation the width of other layout (head of family should be expand or collapse..

my problem is that the animation for menu layout is working properly but the width of other layout not to collapse or expand simultaneously ,how can i do this.

my code is this

//menu layout set animation
                  Thread t=new Thread(new Runnable() {
                      public void run() {
                          try {
                                  runOnUiThread(new Runnable() {
                                  public void run() {

                        } catch (InterruptedException e) {
                            // TODO Auto-generated catch block
                //  lpmenu.setVisibility(View.GONE);
                  flagmenu = false;
                  flagmenu = true;

I want to create the shape of autocomplete textview shown in the figure and text should come in center of it.

enter image description here

Currently I am trying to implement it as

    <shape android:shape="rectangle" >
        <corners android:radius="15dip" />

        <solid android:color="@color/blue_text" />

            android:top="5dip" />


But it would just make the corners of the textview round. It does make it completely round. Please specify any solution for it.

I am working on an app which processes the frames captured by a camera and outputs a String with the processing result.

Up until now I can process the frames I need by calling onClick(), but now I want to process the frames automatically. The process is not long, maybe I need to use a Service (I need advice on this also), but apparently it takes long enough for the device to complain and give Looper related errors, like:

Can't create handler inside thread that has not called Looper.prepare()

or, if I have called it, only one Looper can be created on each thread

What is the best way of handling this?

my android function : im sure that there is no problem with MAP i put in the function

    public class WebServiceController extends  AsyncTask<WebServiceProperties, Void,   String> {

public static String makeRequest(String path, Map<?, ?> params ) throws Exception {

     HttpParams httpParameters = new BasicHttpParams();
        int timeoutConnection = 10000;
        HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
        DefaultHttpClient httpclient = new DefaultHttpClient(httpParameters);

        // url with the post data
        HttpPost httpost = new HttpPost(path);

        // convert parameters into JSON object
        JSONObject holder = new JSONObject(params);

        // passes the results to a string builder/entity
        StringEntity se = new StringEntity(holder.toString());

        // sets the post request as the resulting string

        // sets a request header so the page receiving the request
        // will know what to do with it
        httpost.setHeader("Accept", "application/json");
        httpost.setHeader("Content-type", "application/json");

        // Handles what is returned from the page
        ResponseHandler<String> responseHandler = new BasicResponseHandler();
        String httpResponse = httpclient.execute(httpost, responseHandler);
        return httpResponse;

 protected String doInBackground(WebServiceProperties... params) {
// TODO Auto-generated method stub
int count = params.length;
for (int i = 0; i < count; i++) {
    WebServiceProperties sp=params[i];
    try {
        return makeRequest(sp.getPath(), sp.getParams());
    } catch (Exception e) {
        // TODO Auto-generated catch block
return null;


this is my PHP controller :


class ServiceController extends Zend_Controller_Action

public function init()

     $this->_response->setHeader('Content-Type', 'appication/json');
    $this->_response->setHeader('Access-Control-Allow-Origin', '*');
    $this->_response->setHeader('Access-Control-Max-Age', '3628800');
    $this->_response->setHeader('Access-Control-Allow-Methods', ' GET, POST, PUT,   DELETE');

   public function indexAction()


  public function getVenuesAction()
    $M_Venue = new Model_Venues();
    $venues = $M_Venue->selectVenuesDetails();
    echo Zend_Json::encode($venues);
  public function getAuthAction()
        $mvenue=new Model_Venues();
        $venueRes=$mvenue->venueAuth($venue_id, $realpassword);
    }  catch (Exception $exc)
    echo Zend_Json::encode(array("success"=>$res,'msg'=>$msg,'method'=>$method));


$_POST['password'] and $_POST['venue_id'] throw "undefined index";

this is a photo captured when i debug params enter image description here

I have got this code that connect to a server and send message, it works perfectly, I just don't get the idea of runnable. Is the code within the run(){ } is executed in a loop? I tried puttin a log.e inside, and it only prints once, so how does it actually work?

class ClientThread implements Runnable {

    public void run() {
        Log.e("in run","run");
        try {
            InetAddress serverAddr = InetAddress.getByName(SERVER_IP);
            socket = new Socket(serverAddr, SERVERPORT);
        } catch (UnknownHostException e1) {
        } catch (IOException e1) {


I have installed adt bundle eclipse. however, I can't seems to run the AVD. I have the problem of ADB server didn't ACK * failed to start daemon *

I have search on how to solve it, I've read to type adb kill-server and adb start-server. when I typed that, it says "adb server is out of date. killing... ADB server didn't ACK * failed to start daemon *"

what can i do? please help!

i am new in android and i was working on showing a map i saw code work on something like it but the problem is the project isn't working on any android version except kitkat and it always game me the error message when i remove the tag from the layout.xml file no error occurs but of course no map will be displayed if i put instead of tag it will be the same problem

and as i said before it work only on kitkat ( i tried it on note 2 and it worked) when i made the project put min version 4.0 so clearly the problem is from google play services

so any one can help me with this problem ?please

I am working in Informatica project, and we use to trigger the workflow from Autosys and if workflow fails we get the mail. After that we used to check the session log and find out the error message. Generally the error message is a Network error like failed to connect to Database. My Question is there any way to extract only the error message from the session log like "Failed to Connect to database" and send this in mail.

I have one source table as :
S1 S2 S3 S4 Hi There SSN1 SSN2
where S1, S2, S3 and S4 are column names.

There is a target table likewise which has three fields:
T1 T2 T3

I have another table which is as follows:
Function Target_Column concat(S1,S2) T1 substr(S3,1,3) T2 substr(S3,3,1) T3

I want to have such a mapping in which it can fetch the function name and map according to the function present in the table to the target column specified. My target table now after running the mapping will be:

T1 T2 T3 HiThere SSN 1

How can I achieve this?

I have a problem in INFA where the metadata definitions from source/target tables gets out of sync with the actual definition in the underlying database. I'm working with SFDC connector in INFA, and the SFDC object is changed my integration fails. Is it possible to script to update my source/target table metadata before processing?

I am trying to use joda-time in Android Studio. I have added joda-time-2.3.jar and joda-time-2.3-javadoc.jar to the libs folder of my app. The problem is when I hit ctrl+qto show the quick documentation about the method that I want to use, it does not show anything.

I wonder how can I make the Android Studio to load the documentation for the joda-time? any ideas?

I have a navigation drawer consisting of four list items, I am trying to test out how my app reacts do to orientation changes and starting new Activities. When I rotate my app my Fragment Title changes back to the Main Activity's title. How do I save the title using the onSavedInstanceState method? Also when I start a new Activity and pop my Main Activity up from the backstack, the Navigation Drawer position resets. How do I fix it?

I have converted my Android Application into Modisco project. First I right click on Android project then configure then convert to Modisco project. Now I am unable to run my application.

Now I want to know how can i convert my application back into Android Project.

Thanks in advance

How to specify the path of AndroidManifest in android.mk? I change the path of AndroidManifest, how to specify the path of Androidmanifest? Should the path of AndroidManifest be the same path of android.mk? How many variables that is about AndroidManifest? I just know LOCAL_NO_MANIFEST.