Context menu on Mapactivity

by Premier » Wed, 12 Aug 2009 04:54:36 GMT


Sponsored Links
 Hello,
how i can create context men on MapActivity?

Regards
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. SQLite TIMESTAMP column data type and java.sql.Timestamp

For the application I am working on, I do need to store date
information into the database. To record the date, I am planning to
use an INTEGER column data type, and java.sql.Timestamp for
manipulations. I would like to know if this is a correct approach.

Is it possible to use TIMESTAMP column data type directly?
how can we retrieve this data type using a Cursor?

I do not need nano seconds or dates older than 1970, I do not know how
SQLite manage to store TIMESTAMP data type but AFAIK SQLite 3 uses
varying/dynamic data type (data type that are adapted to the value, in
opposite to a static data type defined for the column), that might
allow optimisations to take place, so it might be more efficient to
use TIMESTAMP instead of INTEGER data type.

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

2. Local communication with a service from another APK that runs in the same process

In case it would help, here is the relevant code:

The two classes (LocalServiceBinder and LocalService) used to bind to
the service and obtain a reference to it:

-----------------------------------------------------------------
package localservice;

import android.os.Binder;

public abstract class LocalServiceBinder extends Binder{
        public abstract LocalService getLocalService();
}

-----------------------------------------------------------------

package localservice;

public interface LocalService{
        public String getPid();
}

-----------------------------------------------------------------

A sample activity in APK #1 that binds with the service and also
implements the ServiceConnection interface
-----------------------------------------------------------------

package kanonov.t1;

import localservice.LocalService;
import localservice.LocalServiceBinder;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;

public class T1 extends Activity implements ServiceConnection{
        public static final String TAG = "Test";

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

                Log.d(TAG, "T1 onCreate");
                bindService(new Intent("kanonov.localservice"), this,
BIND_AUTO_CREATE);
        }

        @Override
        public void onServiceConnected(ComponentName name, IBinder service){
                Log.d(TAG, "T1 onServiceConnected " + 
android.os.Process.myPid());
                if (service == null){
                        try{
                                LocalServiceBinder lsb = 
(LocalServiceBinder)service;
                                LocalService ls = lsb.getLocalService();
                                Log.i(TAG, "My PID is: " + 
android.os.Process.myPid());
                                Log.i(TAG, "LocalService Process' PID is: " + 
ls.getPid());
                        }catch(Exception e){
                                Log.e(TAG, "Error in connection: " + 
e.getMessage(), e);
                        }
                        unbindService(this);
                }else{
                        Log.e(TAG, "Binder is null!");
                }

        }
        @Override
        public void onServiceDisconnected(ComponentName name){}
}


The actual service in APK #2
-----------------------------------------------------------------
package kanonov.t2;

import localservice.LocalService;
import localservice.LocalServiceBinder;
import android.app.Service;
import android.content.Intent;
import android.util.Log;

public class LS extends Service implements LocalService{
        public static final String TAG = "Test";

        @Override
        public LocalServiceBinder onBind(Intent intent){
                Log.d(TAG, "LocalService onBind " + android.os.Process.myPid());
                return new LocalServiceBinder(){

                        @Override
                        public LocalService getLocalService(){
                                Log.d(TAG, "T2LS getLocalService");
                                return LS.this;
                        }

                };

        }

        @Override
        public String getPid(){
                Log.d(TAG, "LocalService getPid");
                return "" + android.os.Process.myPid();
        }
}


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

3. Central service scheduler

4. Need help in writing unit test for parcelable object

5. PhoneStateListener state transitions

6. Bring up active dialer or send dial tone

7. Weekly Nascar Pocket Guide