Socket in AsyncTask - application crashesso the UI won't be blocked

by Jerry Fan » Wed, 21 Jul 2010 16:41:26 GMT


Sponsored Links
 ou can register a handler in your code and send message to update  your UI
component in Handler. I used this way to solve a similar problem like urs
before. For exapmpel

if (socket.isConnected()) {
OutputStreamOut = new
ObjectOutputStream(socket.
getOutputStream());
InputStreamIn = new
ObjectInputStream(socket.getInputStream());
// everything worked fine until here
//instead of doing this, send msg to a customized
handler
//statusTxt.setText("App is now connected to:\n" +
IP + " : "
mHandler.sendEmptyMessage(UPDATE TEXT); //use
something like this
+ Port); // CRASHING !!!!
connectBt.setText("Disconnect");
connected = true;
continueBt.setVisibility(0);
} else {


On Wed, Jul 21, 2010 at 12:25 AM, stephan <dkn...@googlemail.com> wrote:

>



Other Threads

1. Webview load https URL always prompt error

In file CertificateChainValidater.java
Code report NullPointerException in line
synchronized (mDefaultTrustManager) {

//
        // first, we validate the chain using the standard validation
        // solution; if we do not find any errors, we are done; if we
        // fail the standard validation, we re-validate again below,
        // this time trying to retrieve any individual errors we can
        // report back to the user.
        //
        try {
            synchronized (mDefaultTrustManager) {
                mDefaultTrustManager.checkServerTrusted(
                    serverCertificates, "RSA");

                // no errors!!!
                return null;
            }
        } catch (CertificateExcep

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

2. Free developer accounts for GPL / CC-BY* / etc developers

Just a quick thought,

I noticed that several excellent projects that are completely open
source and could truly only further development on android have been
relegated to the backchannels of apk distribution-- that is, off-
site.  With the relatively successful introduction of paid
applications into the market, it only makes sense to charge to become
a de jure developer by paying.

That said, as employees at google (and most psychologists that study
creativity) should be aware, some of the most innovative, visionary
ideas come from those who fall into a few demographics that are
unlikely to use money as a motivating factor for creative endeavors.
So, it seems, at least to me, that it would be a good idea to pair up
with SourceForge (or similar sites) to provide a free way to
distribute open source, legitimate applications to devices via the
market.

That way, we have a definite way to retain a good filter on keeping
out malicious/spam/whatever applications (and revoking those that will
invariably seep in) while still keeping the channels open for open
source developers by not demanding up front monetary investment.  I
feel this would yield net gains:

* boosts creative/innovative development (and allows {*filter*}s without
credit cards or college kids with maxed out credit cards--surprisingly
large portions of extraordinarily good coders--to contribute to the
market),
* reduces the market gap between dalvik-oriented vs. symbian/midlet-
oriented applications,
* provides a greater incentive for google-first rather than apple-
first development and no-risk-just-testing-the-waters development,
* significantly increases positive public relations for the platform
and enthusiasm for it,
* is unquestionably not evil,
* is extraordinarily cost-effective to implement (practically free),
* is no threat to the existing revenue stream (and if anything,
creates a greater likelihood of good developers going on to later
encourage continued loyalty to the android platform+marketplace
distribution framework in commercial endeavors they'd be involved in).

I would suggest that the "free" accounts be strictly limited to
explicitly free, open-source projects with explicit prohibitions on
demo/shareware/etc.

Cheers,
-Kurt

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

3. droid fonts

4. problem with porting mediaplayer to real board

5. Old changelogs?

6. keep printing android_power:wakeup and the machine can't boot

7. Launching a dialog from preferences?