problem with new SDK version android-sdk-windows-1.0_r2

by Ahsan » Sun, 01 Feb 2009 08:09:48 GMT


Sponsored Links
 Hi, I am using the latest SDK android-sdk-windows-1.0_r2 and android
plugin version 0.8.0.v200809220836-110569 But everytime i try to run
an application, the console shows following messages. and DDMS view
shows no device.

[2009-01-31 23:27:02 - test] ------------------------------
[2009-01-31 23:27:02 - test] Android Launch!
[2009-01-31 23:27:02 - test] adb is running normally.
[2009-01-31 23:27:02 - test] Launching: com.nextigen.t1.Test
[2009-01-31 23:27:02 - test] Automatic Target Mode: launching new
emulator.
[2009-01-31 23:27:02 - test] Launching a new emulator.
[2009-01-31 23:27:13 - test] New emulator found: emulator-5554
[2009-01-31 23:27:13 - test] Waiting for HOME
('android.process.acore') to be launched...
[2009-01-31 23:28:29 - test] emulator-5554 disconnected! Cancelling
'com.nextigen.t1.Test' launch!

What can be the possible reason? please help

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. who created these "Binder Thread" ?

After this thread run dozens of loops. The Binder Threads are created,
and can be seen in the eclipse debug window. And these Binder Threads
will never get terminated / released. Where does theme come from? How
to prevent this from happening? Or how to get it teminated / released?



public class TServer {

        static final int HTTP_PORT = 7788;
        private static Context FContext = null;

        static class RequestListenerThread extends Thread {

                private final ServerSocket serversocket;
                private final HttpParams params;

                public RequestListenerThread(Context AContext) throws 
IOException {
                        FContext = AContext;

                        this.serversocket = new ServerSocket(HTTP_PORT);
                        this.params = new BasicHttpParams();
                        this.params
                                        
.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
                                        
.setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE,
                                                        8 * 1024)
                                        .setBooleanParameter(
                                                        
CoreConnectionPNames.STALE_CONNECTION_CHECK, false)
                                        
.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true);
                        // .setParameter(CoreProtocolPNames.ORIGIN_SERVER,
                        // "HttpComponents/1.1");

                }

                public void terminate() {
                        try {
                                serversocket.close();
                                this.interrupt();
                        } catch (Throwable e) {
                                e.printStackTrace();
                        }
                }

                public void run() {
                        while (!Thread.interrupted()) {
                                try {
                                        // Set up HTTP connection
                                        Socket socket = 
this.serversocket.accept();
                                        DefaultHttpServerConnection conn = new 
DefaultHttpServerConnection
();
                                        conn.bind(socket, this.params);

                                        try {
                                                String aUrl = "";
                                                String aRequest = "";
                                                HttpRequest request = 
conn.receiveRequestHeader();
                                                if (request instanceof 
HttpEntityEnclosingRequest) {
                                                        conn
                                                                        
.receiveRequestEntity((HttpEntityEnclosingRequest) request);
                                                        HttpEntity entity = 
((HttpEntityEnclosingRequest) request)
                                                                        
.getEntity();
                                                        if (entity != null) {
                                                                aRequest = 
EntityUtils
                                                                                
.toString(entity, "UTF-8");
                                                                
entity.consumeContent();
                                                        }
                                                }
                                                aUrl = 
request.getRequestLine().getUri();

                                                String aResponse = 
"";

                                                ContentResolver r = 
FContext.getContentResolver();
                                                Cursor c = 
r.query(Contacts.People.CONTENT_URI, null,
                                                                null, null, 
null);
                                                try {
                                                        while (c.moveToNext()) {
                                                                aResponse = 
aResponse.concat(c.getString(c
                                                                                
.getColumnIndex(Contacts.People.NAME)));
                                                                if 
(c.getPosition() > 30) {
                                                                        break;
                                                                }
                                                        }
                                                } finally {
                                                        c.close();
                                                }

                                                HttpResponse response = new 
BasicHttpResponse(
                                                                
HttpVersion.HTTP_1_0, 200, "OK");
                                                response
                                                                .setEntity(new 
StringEntity(aResponse, "UTF-8"));
                                                
conn.sendResponseHeader(response);
                                                
conn.sendResponseEntity(response);
                                        } catch (Throwable e) {
                                                e.printStackTrace();
                                        } finally {
                                                try {
                                                        conn.shutdown();
                                                } catch (Throwable ignore) {
                                                }
                                        }

                                } catch (InterruptedIOException ex) {
                                        ex.printStackTrace();
                                        // break;
                                } catch (IOException e) {
                                        e.printStackTrace();
                                        // break;
                                } catch (Throwable e) {
                                        e.printStackTrace();
                                        // break;
                                }
                        }
                }
        }

}

-- 

2. Cannot view saved image until reboot

Hey all,

I am saving an image taken by the camera to a unique folder on the
sdcard.  The image saves fine, but I cannot view it in the Gallery.  I
can see it in the file system, but I cannot view the image in the
Gallery app until I reboot the phone or mount the sdcard, and then
umount.


Here's the code:


     public static void saveImageToCard (Bitmap bm, String title,
String description, Context context) {

            //replace and append the title with the correct extension
            title = title.replace(" ", "_") + ".jpg";

            File Directory = new File(Environment.getExternalStorageDirectory
() + "/myFolder");
                File file = new File(Directory.getAbsoluteFile() + "/" + title);

                if (!Directory.exists()) {
                        Directory.mkdirs();
                }

                try {
                        FileOutputStream fos = new FileOutputStream(file);
                        bm.compress(Bitmap.CompressFormat.JPEG, 100, fos);
                        fos.close();
                } catch (IOException e) {
                        e.printStackTrace();
                }

        }



As I said, the file is saved fine, I can see it in the FS, and I can
view it after the card has been umounted/mounted or rebooted.   Is it
an issue that I'm not correctly closing the file??  I don't think
that's it, but I'm not sure why I can't view the image.  I believe I
tried saving the file using getContentResolver().insert() and didn't
have this issue, but I want to save the images to a specific folder
that I create.


Any ideas?


Thanks in advance,

Mike






-- 

3. How to perform Web Search without requiring UI

4. Android market developer fee - annual or forever?

5. window27

6. Build Log Errors In Ubuntu 9.10

7. Splitting the homepage screen to two screens