[android-developers] how to skip loading drivers at startup and load them all later on?

2011-05-13 Thread longingtoadopt.com
I am trying an experiment to switch out drivers dynamically - on
demand. On Android 2.2, how to skip loading drivers at startup? I want
to load them at a later time. Is there a blanket command to skip
loading the drivers? Is there another one to start loading all of
them?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: how to skip loading drivers at startup and load them all later on?

2011-05-13 Thread longingtoadopt.com
ok, apologies.

On May 13, 1:54 pm, Justin Anderson magouyaw...@gmail.com wrote:
 This is probably not the right group for this question...  This group is for
 SDK questions and this definitely cannot be done with the SDK

 Thanks,
 Justin Anderson
 MagouyaWare Developerhttp://sites.google.com/site/magouyaware

 On Fri, May 13, 2011 at 12:42 PM, longingtoadopt.com 
 anil.r...@gmail.comwrote:

  I am trying an experiment to switch out drivers dynamically - on
  demand. On Android 2.2, how to skip loading drivers at startup? I want
  to load them at a later time. Is there a blanket command to skip
  loading the drivers? Is there another one to start loading all of
  them?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] building hello-jni sample in Android NDK causes error “Default target help does not exist in this project”

2011-04-15 Thread longingtoadopt.com
Trying to build hello-jni sample in Android NDK. Followed instructions
to create build .xml per 
http://developer.android.com/sdk/ndk/overview.html#samples

android update project -p . -s

Trying to run under Eclipse Helios SR2. I get this error:

Description Resource Path Location Type Default target help does not
exist in this project build.xml /HelloJni line 2 Ant Buildfile Problem

in build.xml,

project name=HelloJni default=help
any suggestions appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Issues installing Opera browser on Froyo 2.2. libopera.so not found

2011-04-04 Thread longingtoadopt.com
I have a dev phone Froyo 2.2 with a non-working browser and wanted to
install another browser on it. On a phone with a working browser, I
downloaded Opera browser from amazon marketplace. However, I cannot
find what the apk name is in /system/app. Does anyone know?

So I went to this site and downloaded the apk to my laptop:
http://getandroidstuff.com/opera-101-android-download-beta-apk/

adb push Opera_Mobile_10.1_beta.apk /system/app

01-01 00:05:42.632: DEBUG/dalvikvm(1680): Trying to load lib /data/
data/com.opera.browser/lib/libopera.so 0x45cb1bb8
01-01 00:05:42.632: INFO/dalvikvm(1680): Unable to dlopen(/data/data/
com.opera.browser/lib/libopera.so): Cannot load library:
load_library[1083]: Library '/data/data/com.opera.browser/lib/
libopera.so' not found
01-01 00:05:42.632: DEBUG/AndroidRuntime(1680): Shutting down VM
01-01 00:05:42.632: WARN/dalvikvm(1680): threadid=1: thread exiting
with uncaught exception (group=0x400208b0)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): FATAL EXCEPTION: main
01-01 00:05:42.640: ERROR/AndroidRuntime(1680):
java.lang.UnsatisfiedLinkError: Library /data/data/com.opera.browser/
lib/libopera.so not found
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at
java.lang.Runtime.load(Runtime.java:409)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at
java.lang.System.load(System.java:536)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at
com.opera.BreamNative.loadLibs(BreamNative.java:125)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at
com.opera.Bream.init(Bream.java:179)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at
com.opera.Opera.backgroundStart(Opera.java:24)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at com.opera.Opera
$1.run(Opera.java:73)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at
android.os.Handler.handleCallback(Handler.java:587)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at
android.os.Handler.dispatchMessage(Handler.java:92)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at
android.os.Looper.loop(Looper.java:123)
01-01 00:05:42.640: ERROR/AndroidRuntime(1680): at
android.app.ActivityThread.main(ActivityThread.java:4627)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: who prevails with audio in simultaneous cell phone and VOIP calls?

2011-02-26 Thread longingtoadopt.com
bump

On Feb 24, 10:27 am, longingtoadopt.com anil.r...@gmail.com wrote:
 I asked a co-worker to make a Linphone VOIP call to me and while the
 call was in progress, I made a regular cell phone call to my wife.
 I was able to hear their voices simultaneously. This was surprising.

 When I play an audio clip on my cell phone and then make a cell phone
 call out, the media player correctly pauses and does not play until
 the call ends – thereupon it resumes playing.

 What decides that the media player audio should be muted during a cell
 phone call?
 Why didn't it get muted during the VOIP call?

 (Android 2.1. HTC Slide)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] who prevails with audio in simultaneous cell phone and VOIP calls?

2011-02-24 Thread longingtoadopt.com
I asked a co-worker to make a Linphone VOIP call to me and while the
call was in progress, I made a regular cell phone call to my wife.
I was able to hear their voices simultaneously. This was surprising.

When I play an audio clip on my cell phone and then make a cell phone
call out, the media player correctly pauses and does not play until
the call ends – thereupon it resumes playing.

What decides that the media player audio should be muted during a cell
phone call?
Why didn't it get muted during the VOIP call?

(Android 2.1. HTC Slide)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: question on KVM/thread scheduler and processor cores

2011-01-26 Thread longingtoadopt.com
Thanks for replying - that removes one layer (KVM).

On Jan 25, 8:30 pm, Dianne Hackborn hack...@android.com wrote:
 Each Dalvik thread is a kernel thread.  The scheduling of these is fairly
 entirely up to the kernel, except for situations such as where a GC may need
 to pause threads.

 On Tue, Jan 25, 2011 at 3:39 PM, longingtoadopt.com 
 anil.r...@gmail.comwrote:



  I need to test a program that says it will restrict the number of
  processor cores being used. I was thinking of writing a program to
  spawn 100 threads, each one performing some long, intensive
  computation. Then from a console, I could see how many cores are being
  used. If I write it in Java (Android), is there a guarantee that the
  JVM/KVM will run the threads on different cores, and run them on all
  the cores? (if the scheduler incorrectly used only one core when two
  are allowed, then that will give me an incorrect result).

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] question on KVM/thread scheduler and processor cores

2011-01-25 Thread longingtoadopt.com
I need to test a program that says it will restrict the number of
processor cores being used. I was thinking of writing a program to
spawn 100 threads, each one performing some long, intensive
computation. Then from a console, I could see how many cores are being
used. If I write it in Java (Android), is there a guarantee that the
JVM/KVM will run the threads on different cores, and run them on all
the cores? (if the scheduler incorrectly used only one core when two
are allowed, then that will give me an incorrect result).

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Cannot compile Desk Alarm Clock (branch eclair ver 2.1)

2010-12-31 Thread longingtoadopt.com
Alright, I created an ubuntu partition, installed git, repo, eclipse, 
downloaded the eclair branch of android and built it.
Created a Java project using 'existing src' with the android root directory.
Was wondering how I should run/step through the Desk Clock application.
Since there is no ADT plugin, If I Run as Java Application it simply 
brings up a list of internal and library modules like Svc, Command shell...
Should I run the emulator in the debugger and then click on the alarm clock 
app? (Debugging the emulator with Eclipse 
http://source.android.com/source/using-eclipse.html)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Cannot compile Desk Alarm Clock (branch eclair ver 2.1)

2010-12-26 Thread longingtoadopt.com
Would prefer not to have to - since I am on Windows

On Sunday, December 26, 2010 1:02:55 AM UTC-6, Zsolt Vasvari wrote:

 Correct, you cannot compile these modules with the SDK alone.  You 
 need to download the platform source and compile those.  I don't know 
 the details. 




-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: how to clone application (Desk Clock) from Git tree that will work for API 7?

2010-12-25 Thread longingtoadopt.com
I realized that repo -b brings the branch and from
$ git help clone
found that it is passed through to git
so this worked!
$ git clone git://android.git.kernel.org/platform/packages/apps/DeskClock.git
-b eclair
Cloning into DeskClock...
remote: Counting objects: 4270, done.
remote: Compressing objects: 100% (1192/1192), done.
remote: Total 4270 (delta 2039), reused 4220 (delta 1996)
Receiving objects: 100% (4270/4270), 1.18 MiB | 196 KiB/s, done.
Resolving deltas: 100% (2039/2039), done.


On Dec 24, 10:53 pm, longingtoadopt.com anil.r...@gmail.com wrote:
 I was trying to run and read through the Desk Clock code.
 I cloned the subtree 
 herehttp://android.git.kernel.org/?p=platform/packages/apps/DeskClock.git...
 However it pulls in the latest code and some of which refers to API
 level 9 variables eg. ACTION_SET_ALARM, EXTRA_HOUR, EXTRA_MESSAGE,
 every_day, never...
 Spent hours trying to get this to compile before I realized this.
 I want the version of DeskClock for API 7.
 How to do this?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Cannot compile Desk Alarm Clock (branch eclair ver 2.1)

2010-12-25 Thread longingtoadopt.com
I want to study and run through the Desk Alarm Clock in order to understand 
it. I cloned the branch for eclair ver 2.1.
However, it does not compile:

DescriptionResourcePathLocationType
ACTION_ALARM_CHANGED cannot be resolved or is not a fieldAlarms.java
/DeskClock/src/com/android/deskclockline 464Java Problem
com.android.internal.R cannot be resolved to a variable
AlarmKlaxon.java/DeskClock/src/com/android/deskclockline 207Java 
Problem
com.android.internal.R cannot be resolved to a variableDeskClock.java
/DeskClock/src/com/android/deskclockline 574Java Problem
com.android.internal.R cannot be resolved to a variableSetAlarm.java
/DeskClock/src/com/android/deskclockline 115Java Problem
The constructor Vibrator() is not visibleAlarmKlaxon.java
/DeskClock/src/com/android/deskclockline 89Java Problem

How do I get past these errors?
Any help appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re:

2010-12-24 Thread longingtoadopt.com
Yes, I agree that the real meaning behind Christmas is lost. (http://
goodnewsforyou.tripod.com/)

On Dec 24, 9:50 pm, saurabh sinha saurs...@gmail.com wrote:
 Hi

 there is bitter truth behind christmas which I felt personally when
 jesus was on earth nobody cared him
 even he was punished by some bad people on cross sign including some
 innocent people

 but while dying he said to everyone I am dying for all of you and
 today everyone missing him
 its just a formality of doing and celebrating christmas

 I mean to say when we have anything near we dont care but after
 missing that same thing we start caring

 well by the way this christmas inspiring to us we should care everyone
 and never make any difference
 it does not matter who is big or small matter should be good for others

 but you know everyone celebrating no body think what are the main
 reason behind this celebration

 I thought deeply and paid homage to that great man who came on earth
 and was good human being that is JESUS

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] how to clone application (Desk Clock) from Git tree that will work for API 7?

2010-12-24 Thread longingtoadopt.com
I was trying to run and read through the Desk Clock code.
I cloned the subtree here 
http://android.git.kernel.org/?p=platform/packages/apps/DeskClock.git;a=tree
However it pulls in the latest code and some of which refers to API
level 9 variables eg. ACTION_SET_ALARM, EXTRA_HOUR, EXTRA_MESSAGE,
every_day, never...
Spent hours trying to get this to compile before I realized this.
I want the version of DeskClock for API 7.
How to do this?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Intent resolution: supplying action+data where filter had only action, causes it to fail

2010-11-01 Thread longingtoadopt.com
Thanks for replying. The aim was to retrieve a PendingIntent and to
modify it. There would be several PendingIntents that had been
registered for multiple alarms. They are also stored in a db to
register upon app startup.

register PendingIntent_i for Alarm_i. [i=0..n]
use the data part of the PendingIntent to identify the alarm number
(any other way to do this?).
retrieve PendingIntent_i from AlarmManager, verify that it is the
correct one, modify some characteristic of it e.g. change text to be
displayed or alert time.

Thank you for pointing out that the Receiver will not be called when
the alarm goes off, if the app is not running - I did not realize
that.
I was using a BroadcastReceiver because I wanted to append the current
time to a TextView each time the alert happens - to see that the alarm
time was indeed modified correctly for that alarm. Also, getActivity()
specifies you use FLAG_ACTIVITY_NEW_TASK - seemed better to reuse the
activity and wasteful to start a new task for repeating alarms and in
this toy program.

Why is there no registerReceiver(BroadcastReceiver) call? The API call
requires an IntentFilter also. Is the API not in sync with what can be
specified through the manifest? (IntentFilter not mandatory there).

I shall look at the android source for the Desktop clock you had
pointed me to in another thread.

Anyway, I am not able to get the alert happen with explicitly
specifying the component.
=
manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.iovercomer android:versionCode=1
android:versionName=1.0
application android:icon=@drawable/icon android:label=@string/
app_name
android:debuggable=true
activity android:name=.TestIntentResolution
android:label=@string/app_name
intent-filter
action 
android:name=android.intent.action.MAIN /
category 
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
receiver
android:name=com.iovercomer.TestIntentResolution.MyAlarmReceiver/
receiver
/application
/manifest
==
package com.iovercomer;

import java.util.Calendar;
import java.util.Date;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.SystemClock;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class TestIntentResolution extends Activity {
public static final String ALERT_ME_ACTION =
com.iovercomer.TestIntentResolution.alertMe;
AlarmManager am;
PendingIntent mPendingIntent;
String uriBase = content://com.iovercomer/alerts/;
Intent alertIntent;
int alarmNumber = 99;
protected int requestCode = 23;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button startButton = (Button) findViewById(R.id.start_alarm);
startButton.setOnClickListener(mStartAlarmListener);
am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alertIntent = new
Intent(TestIntentResolution.this,TestIntentResolution.MyAlarmReceiver.class);
}
private OnClickListener mStartAlarmListener = new OnClickListener() {
@Override
public void onClick(View v) {
Uri alert_i = Uri.parse(uriBase + alarmNumber);
// comment out the following line to get the intent to 
resolve to
the receiver
alertIntent.setData(alert_i);
int flags = PendingIntent.FLAG_UPDATE_CURRENT;
mPendingIntent =
PendingIntent.getBroadcast(TestIntentResolution.this,
requestCode , alertIntent, flags);
long firstTime = SystemClock.elapsedRealtime();
 am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime 
+ 10 *
1000, mPendingIntent);
Toast.makeText(TestIntentResolution.this,
starting  + alarm  + 
alarmNumber,
Toast.LENGTH_LONG).show();

}
};
void alertMe(String time, String data) {
String t = alert! at  + time +   + data + \n;
Toast.makeText(getApplicationContext(), t,
Toast.LENGTH_SHORT).show();
TextView tv = (TextView) findViewById(R.id.myginew);
tv.setText(t);
}
public class 

[android-developers] Intent resolution: supplying action+data where filter had only action, causes it to fail

2010-10-31 Thread longingtoadopt.com
I thought that Action was preeminent during intent resolution and if
the intent had the same action as the intent filter, it would be
considered a match regardless of data, if the filter did not specify
anything.
So I was very surprised to find that  supplying action+data where
filter had only action, causes it to fail.
In the code below, if you comment out line 47 so that data is *not*
sent, only then it resolves correctly.

alertIntent.setData(alert_i);

To get it to work with the data (an id that is simply a String), what
mime type should I specify in the intent filter?
thanks...
-
package com.iovercomer;

import java.util.Calendar;
import java.util.Date;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentFilter.MalformedMimeTypeException;
import android.net.Uri;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class TestIntentResolution extends Activity {
public static final String ALERT_ME_ACTION =
com.iovercomer.TestIntentResolution.alertMe;
AlarmManager am;
PendingIntent mAlarmSender;
String uriBase = content://com.iovercomer/alerts/;
Intent alertIntent;
int alarmNumber = 99;
protected int requestCode = 23;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button startButton = (Button) findViewById(R.id.start_alarm);
startButton.setOnClickListener(mStartAlarmListener);
am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alertIntent = new Intent(ALERT_ME_ACTION);

}
private OnClickListener mStartAlarmListener = new OnClickListener() {
@Override
public void onClick(View v) {
Uri alert_i = Uri.parse(uriBase + alarmNumber);
// comment out the following line to get the intent to 
resolve to
the receiver
alertIntent.setData(alert_i);
int flags = PendingIntent.FLAG_UPDATE_CURRENT;
mAlarmSender =
PendingIntent.getBroadcast(TestIntentResolution.this,
requestCode , alertIntent, flags);
long firstTime = SystemClock.elapsedRealtime();
 am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime 
+ 10 *
1000, mAlarmSender);
Toast.makeText(TestIntentResolution.this,
starting  + alarm  + 
alarmNumber,
Toast.LENGTH_LONG).show();

}
};
@Override
public void onResume() {
super.onResume();
Intent inte = registerReceiver(receiver, new IntentFilter(
ALERT_ME_ACTION));
}

@Override
public void onPause() {
super.onPause();
unregisterReceiver(receiver);
}
void alertMe(String time, String data) {
String t = alert! at  + time +   + data + \n;
Toast.makeText(getApplicationContext(), t,
Toast.LENGTH_SHORT).show();
TextView tv = (TextView) findViewById(R.id.myginew);
tv.setText(t);
}

MyAlarmReceiver receiver = new MyAlarmReceiver();

public class MyAlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Date dt = Calendar.getInstance().getTime();
intent.getAction();
intent.getType();
Uri d = intent.getData();
String frag = (d == null ? :d.getLastPathSegment());
alertMe(dt.toString(), frag);
}
};
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Intent resolution: supplying action+data where filter had only action, causes it to fail

2010-10-31 Thread longingtoadopt.com
 For actions, the field will not be tested if no values have been
 given (treating it as a wildcard); if no data characteristics are
 specified, however, then the filter will only match intents that
 contain no data.


Thanks for your reply...
If you look at the code, I did specify the action in both the Intent
and the Intent filter: ALERT_ME_ACTION
Correct me if I am mistaken but it is intuitive to expect that if the
Actions match then that should be the overriding consideration. It is
analogous to a message or a method call.
If the name of the method matches, then the case no data is also
valid and handled by the same method.


 I suspect that you are confusing intent-filter characteristics with
 IntentFilter characteristics.


I think one is just a convenient way of specifying in XML and the
other is a way of specifying the same thing dynamically. This is also
true of Views.

  To get it to work with the data (an id that is simply a String), what
  mime type should I specify in the intent filter?

 Data is not an id that is simply a String. Data is a Uri. Please use
 a string extra for an arbitrary string.


Yes, the data is a Uri
Here is the value I was using: content://com.iovercomer/alerts/99

I meant that in the line
Intent inte = registerReceiver(receiver, new
IntentFilter(ALERT_ME_ACTION));

If I am now instead trying to specify

public IntentFilter (String action, String dataType)
http://developer.android.com/reference/android/content/IntentFilter.html#IntentFilter%28java.lang.String,%20java.lang.String%29

the MIME type is specified as a String. if it is to be lower case,
what would I use to pass in?

Diahn Hackborn mentioned that the data part is used to distinguish
PendingIntents.

Since I am using PendingIntent.FLAG_UPDATE_CURRENT, I want the
PendingIntent associated with
content://com.iovercomer/alerts/99 to be different from the
PendingIntent for
content://com.iovercomer/alerts/100
Hence I am not simply passing it in as an extra in the Bundle.
thanks,

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en