how to receive general IO events ?

by daemonserj » Sun, 13 Sep 2009 05:02:20 GMT


Sponsored Links
 Hello All!
Is it possible to be notified about general IO in system ?
For example I want to receive some file reading events and blinking
with some indicator...

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



how to receive general IO events ?

by Jack Ha » Sun, 13 Sep 2009 05:32:48 GMT


 Maybe FileObserver is what you are looking for:

     http://developer.android.com/reference/android/os/FileObserver.html 

--
Jack Ha
Open Source Development Center
T  Mobile stick together
The coverage you need at the price you want

The views, opinions and statements in this email are those of
the author solely in their individual capacity, and do not
necessarily represent those of T-Mobile USA, Inc.



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


Sponsored Links


Other Threads

1. Help with error in Android code

Hello,

I am working on a simple application that, for now, just presents a
login page as the starting activity with username and password and a
login button. When you click on the login button, it starts a new
activity after verifying credentials. When I run the application in
the emulator, it stops unexpectedly without even showing the main
activity with this error message : The application ... has stopped
unexpectedly. Please try again later.

It seems that it is the code where I register a listener for the
button click that causes the crash because when I comment the code, at
leas the application starts normally. I can't find the error. Here's
my onCreate method where I register the listener:

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Button loginButton = (Button) findViewById(R.id.login);

        loginButton.setOnClickListener(new View.OnClickListener() {
                public void onClick(View v) {
                        EditText usernameView = (EditText) findViewById
(R.id.username);
                        EditText passwordView = (EditText) findViewById
(R.id.password);
                        mUsername = usernameView.getText().toString();
                        mPassword = passwordView.getText().toString();
                        if (verifyLogin()) {
                                callHome();
                        }
                }
        });
    }

For now, verifyLogin() does nothing and just returns true. The callHome
() method just builds an intent, registers username and password as
extras and starts the other activity with the intent.

When I comment the setOnClickListener() call, I do not get the error.

Please what did I do wrong?

I run eclipse 3.5 with the ADT plugin on Windows Vista 64-bit.

Stphane
--~--~---------~--~----~------------~-------~--~----~

2. Why "onFocusChangeListner" does NOT work

I set focuse change listner for DatePicker, but after I leave the
DatePicker, select option in RadioGroup, it seems DatePicker still have the
focus and the listner never be invoked. why?
here are some code:

DatePicker dpk = (DatePicker) findViewById(R.id.DatePicker01);
dpk.setOnFocusChangeListener(focusChangeListner);

.....
View.OnFocusChangeListener focusChangeListner = new
View.OnFocusChangeListener(){

        public void   onFocusChange(View v,boolean hasFocus){
            Log.d("PregnancyWidget", "OnFocusChangeListner invoked!");
             ....some logic
        }
};

I can not see "onFocusChangeListner invoked" in DDMS log. Please help me!

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

3. Can I get user's gmail address or handset SN to verify them?

4. Sending/Receiving Java Objects to Server

5. Starting an Activity BEHIND the current Activity

6. Problem with creating AVD with 1.6 SDK

7. detect onTouch for widget