[android-developers] NFC Secure Element by Software

2012-09-10 Thread Gorka
Hi all,

I would like to know which are the solutions that nowadays are being 
proposed in order to develop software-based secure elements. I know what a 
Secure Element is, so please don´t tell me that the Secure Element must be 
a hardware device by definition and that it could be an UICC/SIM or an 
embeded device such as the one Google devices have nowadays. I have just 
begun to deepen on mobile transaction issues and, considering that SWP and 
card emulation are not supported by default (solutions that require rooting 
the device are not feasible for the kind of things I want to do), software 
based secure elements is the solution I should use.

By secure element I mean any software development that allow users to 
perform cryptographic operations safely: how to store data safely on my 
device, software related to One Time Passwords (OTP) that are usually used 
on banking operations, certificates, etc.

Any document, tutorial, application that you could suggest me would be 
really appreciated.

Thanks a lot, and regards.

-- 
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: does NFC in gingerbread support card simulate?

2012-05-17 Thread Gorka
Hi Shailen,

I guess you have emulated your MIFARE4k tag rooting your mobile phone
and applying any of the patches that are available on the Internet. Am
I right? I ask you because this solution is fine for research
purposes, but it cannot be applied if you want to publish your app or
sell it.

Regards.

On 8 mayo, 01:20, Shailen Sobhee s.sob...@gmail.com wrote:
 Hello Michael,

 I see that you created the NFCTagInfo App, available on the market. This
 app is, by far, the best Tag reader, because of all the little information
 it can give us, for example the HEX/ASCII values of the sectors.

 Anyway, I just wanted to point out that it is possible to simulate an NFC
 Tag with card emulation. I was able to turn on card emulation on my Samsung
 Nexus S phone which sports a PN65 (=PN544+SmartMX) chip. The emulated card
 was a MIFARE 4K, which is a Type 4 NFC Tag. Using another Nexus S and the
 NXP TagWriter app, I was able to write a plain text message on the
 card-emulated Nexus S.

 Examining the HEX data, the latter was clearly an NDEF message.
 Furthermore, the NXP Tagreader app was able to extract the plain text
 message.

 That said, full card-emulation is possible on the Nexus S!!

 br
 Shailen







 On Wednesday, March 23, 2011 10:03:39 AM UTC+1, Michael Roland wrote:

  Hallo,

  the current SDK does not allow you to use card emulation.

  Anyways, with card *emulation* you will not be able to simulate an
  *NFC tag* (i.e. a tag where you store simple NDEF messages). Card
  emulation mode allows to emulate a contactless smartcard (typically
  used for applications with high security requirements, like credit
  cards). While such a card (emulated or real) can be used to carry NDEF
  messages, I really doubt that this possibility will be made available
  for the Android phones.

  br,
  Michael

  On Mar 23, 5:14 am, Zhihong GUO gzhh...@gmail.com wrote:
   Hi all,

   about NFC in Gingerbread, is it possible to simulate a tag by the SDK? I
   have found the support for tag read/write and P2P push message, but
  haven't
   found any support on card simulate.

   thanks

   James

-- 
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] Problem Creating new Contact with photo

2012-02-03 Thread Gorka PlanetMedia
Hi,

I am trying to create a new Contact with a photo, but my code doesn´t
work properly. The thing is that the first time I execute the code the
new contact doesn´t appear on the Contacts List, but the second time I
execute it the contact appears twice and properly. I have tried the
same code but omitting the section that includes the photo and the
contact appears on the contact list fine the first time I try, so the
problem must be related to the photo inclusion.

I cannot understand why the first execution doesn´t work and the
second one does. As I said, when I create the contact for the second
time the new entrance appears twice on the contact list, with the
contact´s name, photo, and everything, so I guess the problem should
not be on the encoding.

I hope someone can help me.
Thanks a lot for yout time.

Here is my code:

..

// Get the Contact´s Picture
int id =
cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts.PHOTO_ID));
Uri photoUri =
ContentUris.withAppendedId(ContactsContract.Data.CONTENT_URI, id);
Cursor c = getContentResolver().query(photoUri, new String[]
{ContactsContract.CommonDataKinds.Photo.PHOTO}, null, null, null);

byte[] photoBytes = null;
if (c.moveToFirst()) {
photoBytes = c.getBlob(0);

..

protected void createNewContact(String name, String mobileNumber,
String emailAddress, byte[] photo) {
ArrayListContentProviderOperation ops = new
ArrayListContentProviderOperation();

ops.add(ContentProviderOperation.newInsert(
ContactsContract.RawContacts.CONTENT_URI)
.withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, null)
.withValue(ContactsContract.RawContacts.ACCOUNT_NAME, null)
.build());

//-- Names
if(name != null)
{
ops.add(ContentProviderOperation.newInsert(
ContactsContract.Data.CONTENT_URI)
 
.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,
0)
.withValue(ContactsContract.Data.MIMETYPE,
 
ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
.withValue(
 
ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME,
name).build()
);
}

//-- Mobile
Number
...

//-- Email


//-- Photo
if(photo != null)
{
 
ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
 
.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,
0)
 .withValue(ContactsContract.Data.MIMETYPE,
ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE)
 .withValue(ContactsContract.CommonDataKinds.Photo.DATA15,
photo)
 .build());
}

// Asking the Contact provider to create a new
contact
try
{
ContentProviderResult[] result =
getContentResolver().applyBatch(ContactsContract.AUTHORITY,
ops);
}
catch (Exception e)
{
e.printStackTrace();
Log.d(TAG, Exception:  + e.getMessage());
}

Toast.makeText(TraspasoActivity.this, New Contact  + name +
 created !!, Toast.LENGTH_SHORT).show();
}

-- 
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] Problem Creating new Contact with photo

2012-02-01 Thread Gorka
Hi,

I am trying to create a new Contact with a photo, but my code doesn´t
work properly. The thing is that the first time I execute the code the
new contact doesn´t appear on the Contacts List, but the second time I
execute it the contact appears twice and properly. I have tried the
same code but omitting the section that includes the photo and the
contact appears on the contact list fine the first time I try, so the
problem must be related to the photo inclusion.

I cannot understand why the first execution doesn´t work and the
second one does. As I said, when I create the contact for the second
time the new entrance appears twice on the contact list, with the
contact´s name, photo, and everything, so I guess the problem should
not be on the encoding.

I hope someone can help me.
Thanks a lot for yout time.

Here is my code:

..

// Get the Contact´s Picture
int id =
cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts.PHOTO_ID));
Uri photoUri =
ContentUris.withAppendedId(ContactsContract.Data.CONTENT_URI, id);
Cursor c = getContentResolver().query(photoUri, new String[]
{ContactsContract.CommonDataKinds.Photo.PHOTO}, null, null, null);

byte[] photoBytes = null;
if (c.moveToFirst()) {
photoBytes = c.getBlob(0);

..

protected void createNewContact(String name, String mobileNumber,
String emailAddress, byte[] photo) {
ArrayListContentProviderOperation ops = new
ArrayListContentProviderOperation();

ops.add(ContentProviderOperation.newInsert(
ContactsContract.RawContacts.CONTENT_URI)
.withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, null)
.withValue(ContactsContract.RawContacts.ACCOUNT_NAME, null)
.build());

//-- Names
if(name != null)
{
ops.add(ContentProviderOperation.newInsert(
ContactsContract.Data.CONTENT_URI)
 
.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,
0)
.withValue(ContactsContract.Data.MIMETYPE,
 
ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
.withValue(
 
ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME,
name).build()
);
}

//-- Mobile
Number
...

//-- Email


//-- Photo
if(photo != null)
{
 
ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
 
.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,
0)
 .withValue(ContactsContract.Data.MIMETYPE,
ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE)
 .withValue(ContactsContract.CommonDataKinds.Photo.DATA15,
photo)
 .build());
}

// Asking the Contact provider to create a new
contact
try
{
ContentProviderResult[] result =
getContentResolver().applyBatch(ContactsContract.AUTHORITY,
ops);
}
catch (Exception e)
{
e.printStackTrace();
Log.d(TAG, Exception:  + e.getMessage());
}

Toast.makeText(TraspasoActivity.this, New Contact  + name +
 created !!, Toast.LENGTH_SHORT).show();
}

-- 
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] Share my Contact

2012-01-19 Thread Gorka
Hi there,

I am trying to build an application to share contacts via NFC. The
thing is that I can easily share the contacts I have on my agend using
Intent.Action_PICK, but I cannot get mine, since is not in that list.
Obviously I can add my own contact, but it doesn´t make sense to me. I
guess there must be another way to get my own information, but I
cannot figure it out.

I would appreciate any suggestion.

Thanks a lot, Gorka

-- 
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] Problem working with SOAP (lib kSOAP2)

2011-05-10 Thread Gorka
Hi,

I am trying to access to a web service using SOAP using the ksoap2
libraries. The thing is that I can make some examples work, but I
cannot access the service I am interested in.

There is the service: http://apli.bizkaia.net/APPS/DANOK/TQWS/TQ.ASMX
And that is the method I want to consult:
http://apli.bizkaia.net/APPS/DANOK/TQWS/TQ.ASMX?op=GetPasoParada

Sort description

POST /APPS/DANOK/TQWS/TQ.ASMX HTTP/1.1
Host: apli.bizkaia.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: http://tempuri.org/LANTIK_TQWS/TQ/GetPasoParada;

?xml version=1.0 encoding=utf-8?
soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://
schemas.xmlsoap.org/soap/envelope/
  soap:Body
GetPasoParada xmlns=http://tempuri.org/LANTIK_TQWS/TQ;
  strLineastring/strLinea
  strParadastring/strParada
/GetPasoParada
  /soap:Body
/soap:Envelope

That is my code:

private static final String SOAP_ACTION = http://tempuri.org/
LANTIK_TQWS/TQ/GetPasoParada;
private static final String METHOD_NAME = GetPasoParada;
private static final String NAMESPACE = http://tempuri.org/
LANTIK_TQWS/TQ/;
private static final String URL = http://apli.bizkaia.net/APPS/DANOK/
TQWS/TQ.ASMX;

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); //set up
request
request.addProperty(strLinea, *); //variable name, value. I got
the variable name, from the wsdl file!
request.addProperty(strParada, 48036029); //variable name, value.
I got the variable name, from the wsdl file!
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11); //put all required data
into a soap envelope
envelope.setOutputSoapObject(request);  //prepare request
envelope.dotNet = true;
HttpTransportSE httpTransport = new HttpTransportSE(URL);

try {
httpTransport.call(SOAP_ACTION, envelope);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} //send request

SoapObject result=(SoapObject)envelope.bodyIn;
Log.d(TAG, Result:  + result.toString());

The thing is that I don´t get any response. Well, actually I do, but
it is an error message:
GetPasoParadaResponse{GetPasoParadaResult=Object reference not set to
an instance of an object.;}

It would be great if someone knows how can I solve my problem.

Thanks a lot, Gorka

-- 
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: Filtering NFC intents, NDEF message external type

2011-05-04 Thread Gorka Hernando
Hi,

Thanks for your response.

On 4 mayo, 08:04, Michael Roland mi.rol...@gmail.com wrote:
 Hallo Gorka,

 for the moment Android provides no means to directly dispatch your
 application based on anNFCForumExternalType (btw, yourexternal
 type name does not follow the RTD specification, TheExternalType
 Name MUST be formed by taking the domain name of the issuing
 organization, adding a colon, and then adding the type name as managed
 by the organization.)

  By the way, I cannot filter smartposter and URI NDEF message types.
  Could someone tell me how to do this??

 Filtering should work based on the data of the URI record (both for
 the URI record itself and the SmartPoster's embedded URI record). You
 can do this with data ... /.

 br
 Michael

-- 
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: Filtering NFC intents, NDEF message external type

2011-05-03 Thread Gorka
Hi,

Thanks for your response.

As far as I know, using techfiltering I can filter all the tags that
are ndef enabled. However, I cannot filter message types like text,
smart poster, ... or tnf types. If I am wrong please let me know and
tell me where can I take a look to learn how to use the techlists for
filtering.

Regards, Gorka.

On 3 mayo, 10:16, pubu he pubu...@gmail.com wrote:
 Have you tried to use techlist for filtering? I think it should work now.







 On Mon, May 2, 2011 at 6:23 PM, Gorka gork...@gmail.com wrote:
  Hi,

  I am trying to work with NDEF and external message types.

  I have defined my NDEF message as you can see there:
  urn:nfc:ext:busInfo.company.com. I can see the message is correct
  using some applications I have instaled in my PC.

  When the Nexus detects the tag, I select the tagReader application and
  it says the tag format is unknown, what I guess is correct. If I
  choose my application, I use the getTNF and getID methods and I see
  ExternalType and my company name, so it is working great.

  What I want to do is to filter the application to be opened using the
  NDEF message type. Rigth now I can filter text messages as I defined
  in the documentation:

  intent-filter
                 action android:name=android.nfc.action.NDEF_DISCOVERED/

                         data android:mimeType=text/* /

                         category
  android:name=android.intent.category.DEFAULT/
             /intent-filter --

  I would like to do something similar for unknown message type and
  filter the application to be opened directly in my Manifest file. I
  mean, change the data android:mimeType by something where I would set
  the ID of my company, so that it would be opened without having to
  select it from the dispatcher. Is that possible¿¿

  By the way, I cannot filter smartposter and URI NDEF message types.
  Could someone tell me how to do this??

  Thanks a lot,
  Gorka.

  --
  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] Filtering NFC intents, NDEF message external type

2011-05-02 Thread Gorka
Hi,

I am trying to work with NDEF and external message types.

I have defined my NDEF message as you can see there:
urn:nfc:ext:busInfo.company.com. I can see the message is correct
using some applications I have instaled in my PC.

When the Nexus detects the tag, I select the tagReader application and
it says the tag format is unknown, what I guess is correct. If I
choose my application, I use the getTNF and getID methods and I see
ExternalType and my company name, so it is working great.

What I want to do is to filter the application to be opened using the
NDEF message type. Rigth now I can filter text messages as I defined
in the documentation:

intent-filter
action android:name=android.nfc.action.NDEF_DISCOVERED/

data android:mimeType=text/* /

category 
android:name=android.intent.category.DEFAULT/
/intent-filter --

I would like to do something similar for unknown message type and
filter the application to be opened directly in my Manifest file. I
mean, change the data android:mimeType by something where I would set
the ID of my company, so that it would be opened without having to
select it from the dispatcher. Is that possible¿¿

By the way, I cannot filter smartposter and URI NDEF message types.
Could someone tell me how to do this??

Thanks a lot,
Gorka.

-- 
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 not received after application started

2011-04-18 Thread Gorka
Hi,

Finally I made it work, so I post the solution as someone could be
interested in the future:
The point is to set the activity launchmode to singleTask
(singleInstance should work too) instead of singleTop

android:launchMode=singleTask

Bye.

On 11 abr, 14:54, Gorka gork...@gmail.com wrote:
 Hi,

 I don´t know if someone is reading me, but I don´t give up :). Maybe
 that could be useful for someone in the future.
 My Manifest file looks like that rigth now:

 intent-filter
       action android:name=android.intent.action.MAIN /
       category android:name=android.intent.category.LAUNCHER /
 /intent-filter
 intent-filter
      action android:name=android.nfc.action.NDEF_DISCOVERED/
      data android:mimeType=*/* /

      category android:name=android.intent.category.DEFAULT/
 /intent-filter

 What is happening rigth now is that, if I start by myself the
 application, it runs ok and I get the onNewIntent messages I am
 supposed to used. So the application reads all the tags. However, if
 the application is started when it detects a tag, it doesn´t receive
 onNewIntent messages anymore.

 Does anyone know how to solve this?
 I continue reading ...

 Bye.

 On 11 abr, 10:36, Gorka gork...@gmail.com wrote:







  Hi,

  Here I am once again.

  I have seen that if I minimize the app, when I detect a new tag the
  application is restarted and the OnRestart and OnResume methods are
  called. But the OnNewIntent isnotreceived.

  But the way, if the application is restarted, how can I get the
  activity that was called¿?

  On 11 abr, 10:22, Gorka gork...@gmail.com wrote:

   Hi,

   Here is the message I get when the phone detects the tag.
   As I said, the first time the app is started, but the second time
   nothing happens.

   I/ActivityManager (107): Startingintent:
   {act=android.nfc.action.NDEF_DISCOVERED typ=text/plain flg=0x0100
   cmp=com.android.nfcvoicereader/.nfcvoicereader (has extras) } from pid
   189

   Thanks.

   On 11 abr, 09:48, Gorka gork...@gmail.com wrote:

Hi,

Yes, I have the onNewIntent method declared as you said.

@Override
    public void onNewIntent(Intentintent) {
    Log.d(TAG,  On NewIntent);

}

The problem is that i don´t get the message.

On 9 abr, 09:34, nadam a...@anyro.se wrote:

 Make sure onNewIntent is overridden correctly. Should look like this:

 @Override
 public void onNewIntent(Intentintent) {
     ...

 }

 On 8 Apr, 16:11, Gorka gork...@gmail.com wrote:

  Hi,

  I am trying to read NFC tags with my Nexus S mobile.

  In my Manifest file I have theintentfiltered:

           intent-filter
                  action
  android:name=android.nfc.action.NDEF_DISCOVERED/

                          data android:mimeType=*/* /

                   category
  android:name=android.intent.category.DEFAULT/
          /intent-filter

  When the mobile detects a tag and theintentis created by the system,
  my application is started. So, the filter works fine.

  The problem is that, once the application is opened viaIntent, if 
  the
  mobile detects another NDEF_DISCOVERED the application doesnot
  receive it.

  I have implemented the onNewIntent method, but it isnotcalled. I
  also have added the android:launchMode=singleTop line to my
  activity.

  Does anyone know can I solve my problem?

  Thanks and bye.

-- 
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 not received after application started

2011-04-11 Thread Gorka
Hi,

Yes, I have the onNewIntent method declared as you said.

@Override
public void onNewIntent(Intent intent) {
Log.d(TAG,  On New Intent);
}

The problem is that i don´t get the message.


On 9 abr, 09:34, nadam a...@anyro.se wrote:
 Make sure onNewIntent is overridden correctly. Should look like this:

 @Override
 public void onNewIntent(Intentintent) {
     ...

 }

 On 8 Apr, 16:11, Gorka gork...@gmail.com wrote:







  Hi,

  I am trying to read NFC tags with my Nexus S mobile.

  In my Manifest file I have theintentfiltered:

           intent-filter
                  action
  android:name=android.nfc.action.NDEF_DISCOVERED/

                          data android:mimeType=*/* /

                   category
  android:name=android.intent.category.DEFAULT/
          /intent-filter

  When the mobile detects a tag and theintentis created by the system,
  my application is started. So, the filter works fine.

  The problem is that, once the application is opened viaIntent, if the
  mobile detects another NDEF_DISCOVERED the application doesnot
  receive it.

  I have implemented the onNewIntent method, but it isnotcalled. I
  also have added the android:launchMode=singleTop line to my
  activity.

  Does anyone know can I solve my problem?

  Thanks and bye.

-- 
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 not received after application started

2011-04-11 Thread Gorka
Hi,

Here is the message I get when the phone detects the tag.
As I said, the first time the app is started, but the second time
nothing happens.

I/ActivityManager (107): Starting intent:
{act=android.nfc.action.NDEF_DISCOVERED typ=text/plain flg=0x0100
cmp=com.android.nfcvoicereader/.nfcvoicereader (has extras) } from pid
189

Thanks.

On 11 abr, 09:48, Gorka gork...@gmail.com wrote:
 Hi,

 Yes, I have the onNewIntent method declared as you said.

 @Override
     public void onNewIntent(Intent intent) {
     Log.d(TAG,  On New Intent);

 }

 The problem is that i don´t get the message.

 On 9 abr, 09:34, nadam a...@anyro.se wrote:







  Make sure onNewIntent is overridden correctly. Should look like this:

  @Override
  public void onNewIntent(Intentintent) {
      ...

  }

  On 8 Apr, 16:11, Gorka gork...@gmail.com wrote:

   Hi,

   I am trying to read NFC tags with my Nexus S mobile.

   In my Manifest file I have theintentfiltered:

            intent-filter
                   action
   android:name=android.nfc.action.NDEF_DISCOVERED/

                           data android:mimeType=*/* /

                    category
   android:name=android.intent.category.DEFAULT/
           /intent-filter

   When the mobile detects a tag and theintentis created by the system,
   my application is started. So, the filter works fine.

   The problem is that, once the application is opened viaIntent, if the
   mobile detects another NDEF_DISCOVERED the application doesnot
   receive it.

   I have implemented the onNewIntent method, but it isnotcalled. I
   also have added the android:launchMode=singleTop line to my
   activity.

   Does anyone know can I solve my problem?

   Thanks and bye.

-- 
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 not received after application started

2011-04-11 Thread Gorka
Hi,

Here I am once again.

I have seen that if I minimize the app, when I detect a new tag the
application is restarted and the OnRestart and OnResume methods are
called. But the OnNewIntent is not received.

But the way, if the application is restarted, how can I get the
activity that was called¿?

On 11 abr, 10:22, Gorka gork...@gmail.com wrote:
 Hi,

 Here is the message I get when the phone detects the tag.
 As I said, the first time the app is started, but the second time
 nothing happens.

 I/ActivityManager (107): Starting intent:
 {act=android.nfc.action.NDEF_DISCOVERED typ=text/plain flg=0x0100
 cmp=com.android.nfcvoicereader/.nfcvoicereader (has extras) } from pid
 189

 Thanks.

 On 11 abr, 09:48, Gorka gork...@gmail.com wrote:







  Hi,

  Yes, I have the onNewIntent method declared as you said.

  @Override
      public void onNewIntent(Intent intent) {
      Log.d(TAG,  On New Intent);

  }

  The problem is that i don´t get the message.

  On 9 abr, 09:34, nadam a...@anyro.se wrote:

   Make sure onNewIntent is overridden correctly. Should look like this:

   @Override
   public void onNewIntent(Intentintent) {
       ...

   }

   On 8 Apr, 16:11, Gorka gork...@gmail.com wrote:

Hi,

I am trying to read NFC tags with my Nexus S mobile.

In my Manifest file I have theintentfiltered:

         intent-filter
                action
android:name=android.nfc.action.NDEF_DISCOVERED/

                        data android:mimeType=*/* /

                 category
android:name=android.intent.category.DEFAULT/
        /intent-filter

When the mobile detects a tag and theintentis created by the system,
my application is started. So, the filter works fine.

The problem is that, once the application is opened viaIntent, if the
mobile detects another NDEF_DISCOVERED the application doesnot
receive it.

I have implemented the onNewIntent method, but it isnotcalled. I
also have added the android:launchMode=singleTop line to my
activity.

Does anyone know can I solve my problem?

Thanks and bye.

-- 
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 not received after application started

2011-04-11 Thread Gorka
Hi,

I don´t know if someone is reading me, but I don´t give up :). Maybe
that could be useful for someone in the future.
My Manifest file looks like that rigth now:

intent-filter
  action android:name=android.intent.action.MAIN /
  category android:name=android.intent.category.LAUNCHER /
/intent-filter
intent-filter
 action android:name=android.nfc.action.NDEF_DISCOVERED/
 data android:mimeType=*/* /

 category android:name=android.intent.category.DEFAULT/
/intent-filter

What is happening rigth now is that, if I start by myself the
application, it runs ok and I get the onNewIntent messages I am
supposed to used. So the application reads all the tags. However, if
the application is started when it detects a tag, it doesn´t receive
onNewIntent messages anymore.

Does anyone know how to solve this?
I continue reading ...

Bye.


On 11 abr, 10:36, Gorka gork...@gmail.com wrote:
 Hi,

 Here I am once again.

 I have seen that if I minimize the app, when I detect a new tag the
 application is restarted and the OnRestart and OnResume methods are
 called. But the OnNewIntent is not received.

 But the way, if the application is restarted, how can I get the
 activity that was called¿?

 On 11 abr, 10:22, Gorka gork...@gmail.com wrote:







  Hi,

  Here is the message I get when the phone detects the tag.
  As I said, the first time the app is started, but the second time
  nothing happens.

  I/ActivityManager (107): Starting intent:
  {act=android.nfc.action.NDEF_DISCOVERED typ=text/plain flg=0x0100
  cmp=com.android.nfcvoicereader/.nfcvoicereader (has extras) } from pid
  189

  Thanks.

  On 11 abr, 09:48, Gorka gork...@gmail.com wrote:

   Hi,

   Yes, I have the onNewIntent method declared as you said.

   @Override
       public void onNewIntent(Intent intent) {
       Log.d(TAG,  On New Intent);

   }

   The problem is that i don´t get the message.

   On 9 abr, 09:34, nadam a...@anyro.se wrote:

Make sure onNewIntent is overridden correctly. Should look like this:

@Override
public void onNewIntent(Intentintent) {
    ...

}

On 8 Apr, 16:11, Gorka gork...@gmail.com wrote:

 Hi,

 I am trying to read NFC tags with my Nexus S mobile.

 In my Manifest file I have theintentfiltered:

          intent-filter
                 action
 android:name=android.nfc.action.NDEF_DISCOVERED/

                         data android:mimeType=*/* /

                  category
 android:name=android.intent.category.DEFAULT/
         /intent-filter

 When the mobile detects a tag and theintentis created by the system,
 my application is started. So, the filter works fine.

 The problem is that, once the application is opened viaIntent, if the
 mobile detects another NDEF_DISCOVERED the application doesnot
 receive it.

 I have implemented the onNewIntent method, but it isnotcalled. I
 also have added the android:launchMode=singleTop line to my
 activity.

 Does anyone know can I solve my problem?

 Thanks and bye.

-- 
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] Intent not received after application started

2011-04-08 Thread Gorka
Hi,

I am trying to read NFC tags with my Nexus S mobile.

In my Manifest file I have the intent filtered:

 intent-filter
action
android:name=android.nfc.action.NDEF_DISCOVERED/

data android:mimeType=*/* /

 category
android:name=android.intent.category.DEFAULT/
/intent-filter

When the mobile detects a tag and the intent is created by the system,
my application is started. So, the filter works fine.

The problem is that, once the application is opened via Intent, if the
mobile detects another NDEF_DISCOVERED the application does not
receive it.

I have implemented the onNewIntent method, but it is not called. I
also have added the android:launchMode=singleTop line to my
activity.

Does anyone know can I solve my problem?

Thanks and bye.

-- 
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] Intent Not Received after application started

2011-04-07 Thread Gorka Hernando
Hi,

I am trying to read NFC tags with my Nexus S mobile.

In my Manifest file I have the intent filtered:

 intent-filter
action android:name=android.nfc.action.NDEF_DISCOVERED/

data android:mimeType=*/* /

 category android:name=android.intent.category.DEFAULT/
/intent-filter

When the mobile detects a tag and the intent is created by the system,
my application is started. So, the filter works fine.

The problem is that, once the application is opened via Intent, if the
mobile detects another NDEF_DISCOVERED the application does not
receive it.

I have implemented the onNewIntent method, but it is not called. I
also have added the android:launchMode=singleTop line to my
activity.

Does anyone know can I solve my problem?

Thanks and bye.

-- 
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: Activity without GUI - Activity

2011-04-06 Thread Gorka Hernando
Hi,

Thanks a lot for your time. It was really helpful

On 6 abr, 09:13, Dianne Hackborn hack...@android.com wrote:
 Right use Theme.NoDisplay

 AND

 You MUST call finish() by the time you return from onResume().

 Different component types are not interchangeable.  If something is
 launching an activity, you must implement an activity to receive that.  You
 can however in that activity do something and then immediately exit so that
 the user doesn't see your activity.









 On Tue, Apr 5, 2011 at 11:42 PM, dgtale dgt...@gmail.com wrote:
  Hi Hernando,

  try using the Theme.NoDisplay:

   activity android:name=..
     android:theme=@android:style/Theme.NoDisplay
      android:label=@string/app_name 

  --
  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

 --
 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] Activity without GUI - Activity

2011-04-05 Thread Gorka
Hi,

I want to deploy an application that reads a NFC tag and shows the
text on the screen with a Toast and reads it using a texttospeach
class. So, I don´t want to start an activity because I don´t need any
GUI. Is that possible?

I have tried to remove the activity tags from the manifest but that
way the application doesn´t work. Is it possible to set the HOME view
within the OnCreate method instead of using R.layout.main ?? If it is
possible please tell me how to do it because I don´t know how to get
this view.

Thanks a lot.

-- 
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: Activity without GUI - Activity

2011-04-05 Thread Gorka Hernando
Ok,

But if I create my application as a service it will start when the
intent occurs? I mean, when the mobile detects the tag and creates the
NDEF .. intent will the application get this intent and show the toast
on the screen??

Thanks

On 5 abr, 10:01, Zsolt Vasvari zvasv...@gmail.com wrote:
 An app without a UI is a service.

 On Apr 5, 3:55 pm, Gorka gork...@gmail.com wrote:







  Hi,

  I want to deploy an application that reads a NFC tag and shows the
  text on the screen with a Toast and reads it using a texttospeach
  class. So, I don´t want to start an activity because I don´t need any
  GUI. Is that possible?

  I have tried to remove the activity tags from the manifest but that
  way the application doesn´t work. Is it possible to set the HOME view
  within the OnCreate method instead of using R.layout.main ?? If it is
  possible please tell me how to do it because I don´t know how to get
  this view.

  Thanks a lot.

-- 
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: Activity without GUI - Activity

2011-04-05 Thread Gorka Hernando
Hi again,

Sorry if I am posting too much, but I really need to make this work
today.
Here it is my manifest file. I have created a service and a receiver
to get the NDEF_DISCOVERED intent.

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.android.nfcvoicereader android:versionCode=1
android:versionName=1.0
uses-sdk android:minSdkVersion=10 /

application android:icon=@drawable/icon android:label=@string/
app_name
service android:enabled=true android:name=MyService/
service
receiver android:enabled=true
android:name=com.android.MyIntentReceiver
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter

intent-filter
action android:name=android.nfc.action.NDEF_DISCOVERED/

data android:mimeType=text/plain /

category 
android:name=android.intent.category.DEFAULT/
/intent-filter
/receiver

uses-feature android:name=android.hardware.nfc
android:required=true /
/application
/manifest

Inside my project there is a receiver class which should get the
intent so that I can start the service.

public class MyIntentReceiver extends BroadcastReceiver {
static final String TAG = BROADCAST RECEIVER;

  @Override
  public void onReceive(Context _context, Intent _intent) {
.
 }
}

Can someone tell me what I am doing wrong ??

Thanks


On 5 abr, 10:01, Zsolt Vasvari zvasv...@gmail.com wrote:
 An app without a UI is a service.

 On Apr 5, 3:55 pm, Gorka gork...@gmail.com wrote:







  Hi,

  I want to deploy an application that reads a NFC tag and shows the
  text on the screen with a Toast and reads it using a texttospeach
  class. So, I don´t want to start an activity because I don´t need any
  GUI. Is that possible?

  I have tried to remove the activity tags from the manifest but that
  way the application doesn´t work. Is it possible to set the HOME view
  within the OnCreate method instead of using R.layout.main ?? If it is
  possible please tell me how to do it because I don´t know how to get
  this view.

  Thanks a lot.

-- 
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: Activity without GUI - Activity

2011-04-05 Thread Gorka Hernando
Hi,

Thanks for your response.
I am taking a look at it.

I am not sure if I am working in the rigth way. Since I want the
service to execute when the tag is detected, I guess I have to declare
a BroadcastReceiver within my packet so that when I receive the intent
I can start the service. Is that correct? The thing is that I am not
receiving the intent at all, I am sure the action.NDEF is taking place
because I see it in the debug window. However, my receiver doesn´t get
it. The way I have declared the receiver in the manifest and in the
java class is above.

Can you please tell me if what I am doing make sense or not. Because
it seems to me that I am wasting my time because this is not the
correct form to work whit this things.

Thanks.


On 5 abr, 13:36, skink psk...@gmail.com wrote:
 On Apr 5, 10:45 am, Gorka Hernando g.herna...@ogmio.com wrote:









  Hi again,

  Sorry if I am posting too much, but I really need to make this work
  today.
  Here it is my manifest file. I have created a service and a receiver
  to get the NDEF_DISCOVERED intent.

  ?xml version=1.0 encoding=utf-8?
  manifest xmlns:android=http://schemas.android.com/apk/res/android;
        package=com.android.nfcvoicereader android:versionCode=1
  android:versionName=1.0
      uses-sdk android:minSdkVersion=10 /

      application android:icon=@drawable/icon android:label=@string/
  app_name
      service android:enabled=true android:name=MyService/
  service
      receiver android:enabled=true
  android:name=com.android.MyIntentReceiver
                  intent-filter
                  action android:name=android.intent.action.MAIN /
                  category
  android:name=android.intent.category.LAUNCHER /
              /intent-filter

              intent-filter
                  action android:name=android.nfc.action.NDEF_DISCOVERED/

                          data android:mimeType=text/plain /

                          category 
  android:name=android.intent.category.DEFAULT/
              /intent-filter
      /receiver

      uses-feature android:name=android.hardware.nfc
  android:required=true /
      /application
  /manifest

  Inside my project there is a receiver class which should get the
  intent so that I can start the service.

  public class MyIntentReceiver extends BroadcastReceiver {
          static final String TAG = BROADCAST RECEIVER;

            @Override
            public void onReceive(Context _context, Intent _intent) {
              .
           }

  }

  Can someone tell me what I am doing wrong ??

 See Context docs to find a method that starts a service

 pskink

-- 
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: Activity without GUI - Activity

2011-04-05 Thread Gorka Hernando
Sorry, I forgot to say that after the broadcast is catched withing the
onreceive I have this code:

public void onReceive(Context context, Intent intent) {
// show first message
Toast toast = Toast.makeText(context, test, Toast.LENGTH_LONG);
toast.show();

context.startService(serviceIntent);
}

Maybe you meant this line: context.startService(serviceIntent); when
you sais how to start a service.
The problem as I said is that I cannot get the intent

On 5 abr, 14:42, Gorka Hernando g.herna...@ogmio.com wrote:
 Hi,

 Thanks for your response.
 I am taking a look at it.

 I am not sure if I am working in the rigth way. Since I want the
 service to execute when the tag is detected, I guess I have to declare
 a BroadcastReceiver within my packet so that when I receive the intent
 I can start the service. Is that correct? The thing is that I am not
 receiving the intent at all, I am sure the action.NDEF is taking place
 because I see it in the debug window. However, my receiver doesn´t get
 it. The way I have declared the receiver in the manifest and in the
 java class is above.

 Can you please tell me if what I am doing make sense or not. Because
 it seems to me that I am wasting my time because this is not the
 correct form to work whit this things.

 Thanks.

 On 5 abr, 13:36, skink psk...@gmail.com wrote:







  On Apr 5, 10:45 am, Gorka Hernando g.herna...@ogmio.com wrote:

   Hi again,

   Sorry if I am posting too much, but I really need to make this work
   today.
   Here it is my manifest file. I have created a service and a receiver
   to get the NDEF_DISCOVERED intent.

   ?xml version=1.0 encoding=utf-8?
   manifest xmlns:android=http://schemas.android.com/apk/res/android;
         package=com.android.nfcvoicereader android:versionCode=1
   android:versionName=1.0
       uses-sdk android:minSdkVersion=10 /

       application android:icon=@drawable/icon android:label=@string/
   app_name
       service android:enabled=true android:name=MyService/
   service
       receiver android:enabled=true
   android:name=com.android.MyIntentReceiver
                   intent-filter
                   action android:name=android.intent.action.MAIN /
                   category
   android:name=android.intent.category.LAUNCHER /
               /intent-filter

               intent-filter
                   action android:name=android.nfc.action.NDEF_DISCOVERED/

                           data android:mimeType=text/plain /

                           category 
   android:name=android.intent.category.DEFAULT/
               /intent-filter
       /receiver

       uses-feature android:name=android.hardware.nfc
   android:required=true /
       /application
   /manifest

   Inside my project there is a receiver class which should get the
   intent so that I can start the service.

   public class MyIntentReceiver extends BroadcastReceiver {
           static final String TAG = BROADCAST RECEIVER;

             @Override
             public void onReceive(Context _context, Intent _intent) {
               .
            }

   }

   Can someone tell me what I am doing wrong ??

  See Context docs to find a method that starts a service

  pskink

-- 
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: Activity without GUI - Activity

2011-04-05 Thread Gorka Hernando
Hi,

The thing is, if I create an Activity it always will show something on
the screen, rigth?
Even if I do not set any view, like in this code, it always appear the
black screen of the activity. I can call to finish as soon as I read
the tag and I show the toast, but it is not nice.

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main)
}

When you say not to load any xml what do you mean really? It would be
great not to show nothing on screen, just the toast and then call to
finish and the user would not realize that an activity has been
opened.

I am a bit new to Android, so if you can explain me more in detail it
would be great.

Thanks for your time.

On 5 abr, 16:15, nathan forbes me.li...@nathanforbes.com wrote:
 Couldn't you just create a normal activity using onCreate and not load any
 XML layouts? Instead of creating receivers? Then you would have a context to
 work with to show a Toast and what not...

 Or am I way off here... I'm fairly new with this also.

 On Apr 5, 2011 9:53 AM, Zsolt Vasvari zvasv...@gmail.com wrote:









  Maybe the LAUNCHER stuff is causing a problem?  If you have your
  intent filter set up ok, you should at least receive the intent.

  On Apr 5, 8:45 pm, Gorka Hernando g.herna...@ogmio.com wrote:
   Sorry, I forgot to say that after the broadcast is catched withing the
   onreceive I have this code:

   public void onReceive(Context context, Intent intent) {
               // show first message
               Toast toast = Toast.makeText(context, test,
 Toast.LENGTH_LONG);
               toast.show();

               context.startService(serviceIntent);

   }

   Maybe you meant this line: context.startService(serviceIntent); when
   you sais how to start a service.
   The problem as I said is that I cannot get the intent

   On 5 abr, 14:42, Gorka Hernando g.herna...@ogmio.com wrote:

Hi,

Thanks for your response.
I am taking a look at it.

I am not sure if I am working in the rigth way. Since I want the
service to execute when the tag is detected, I guess I have to declare
a BroadcastReceiver within my packet so that when I receive the intent
I can start the service. Is that correct? The thing is that I am not
receiving the intent at all, I am sure the action.NDEF is taking place
because I see it in the debug window. However, my receiver doesn´t get
it. The way I have declared the receiver in the manifest and in the
java class is above.

Can you please tell me if what I am doing make sense or not. Because
it seems to me that I am wasting my time because this is not the
correct form to work whit this things.

Thanks.

On 5 abr, 13:36, skink psk...@gmail.com wrote:

 On Apr 5, 10:45 am, Gorka Hernando g.herna...@ogmio.com wrote:

  Hi again,

  Sorry if I am posting too much, but I really need to make this
 work
  today.
  Here it is my manifest file. I have created a service and a
 receiver
  to get the NDEF_DISCOVERED intent.

  ?xml version=1.0 encoding=utf-8?
  manifest xmlns:android=

 http://schemas.android.com/apk/res/android;       
 package=com.android.nfcvoicereader android:versionCode=1
  android:versionName=1.0
      uses-sdk android:minSdkVersion=10 /

      application android:icon=@drawable/icon

 android:label=@string/ app_name
      service android:enabled=true android:name=MyService/
  service
      receiver android:enabled=true
  android:name=com.android.MyIntentReceiver
                  intent-filter
                  action android:name=android.intent.action.MAIN
 /
                  category
  android:name=android.intent.category.LAUNCHER /
              /intent-filter

              intent-filter
                  action

 android:name=android.nfc.action.NDEF_DISCOVERED/

                          data android:mimeType=text/plain /

                          category

 android:name=android.intent.category.DEFAULT/







              /intent-filter
      /receiver

      uses-feature android:name=android.hardware.nfc
  android:required=true /
      /application
  /manifest

  Inside my project there is a receiver class which should get the
  intent so that I can start the service.

  public class MyIntentReceiver extends BroadcastReceiver {
          static final String TAG = BROADCAST RECEIVER;

            @Override
            public void onReceive(Context _context, Intent _intent)
 {
              .
           }

  }

  Can someone tell me what I am doing wrong ??

 See Context docs to find a method that starts a service

 pskink- Hide quoted text -

   - Show quoted text -

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email

[android-developers] SIM NFC (card emulation). SWP support?

2011-03-28 Thread Gorka Hernando
Hi,

I have just get a SIM card where a MIFARE Classic 1k tag has been
emulated. I put it into the Samsung GT-5230N mobile phone and I can
read it with my NFC reader as a common tag. This is possible because
the 5230N has full SWP (Single Wire Protocol). Moreover, I can connect
to the applet running in the SIM and check the values as I can do with
the reader and show the values on the screen, e.g. the tickets
remaining.

As far as I see in the Internet, the Nexus S has SWP support. Is that
true? I mean, right now is the SWP available? If I insert the SIM into
the Nexus S would it work as well as it does with the S5230n? Is it
possible to access the applets and read the values to show them on the
screen??

Thanks a lot.

-- 
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: NFC doubts. JSR 257 - 177

2011-01-24 Thread Gorka Hernando
Hi,

The thing is what Andrew says. I am working with an sticker always
connected to the mobile phone, so once the mobile detects the sticker
and reads it, is not possible to read it again unless I remove it and
stick it again (what obviously is not acceptable to me). What I want
to do is somehow whenever I start my application is to be able to read
the tag without having to remove it from the mobile phone.

The sticker is similar to these ones
http://cdn2.ubergizmo.com/wp-content/uploads/2010/12/iphone-nfc-japan-sticker-softbank.jpeg

Thanks and regards


On 23 ene, 03:55, Ben Dodson bjdod...@gmail.com wrote:
 I had trouble cut/pasting from the git source to google group as well.
 The package is here:

 android.git.kernel.org/?p=platform/packages/apps/Tag.git;a=summary

 On Jan 22, 4:30 pm, davemac davemac...@gmail.com wrote:

  H. Dianne's link doesn't appear to work. Any help here?

  - dave

  On Jan 18, 9:12 pm, Dianne Hackborn hack...@android.com wrote:

   There are links at the bottom of the page to the full source.  This is 
   also
   part of the platform sample code, so it is included with all of the other
   sample code you can download.

   Also of course you can always look at the actual code of the standard NFC
   Tag app:

  http://android.git.kernel.org/?p=platform/packages/apps/Tag.git;a=tree

   On Tue, Jan 18, 2011 at 5:10 AM, mduffy215 mduffy...@gmail.com wrote:
Has anyone been able to create a demo for NFC on Android 2.3?

The support from Google is incredibly lame:
   http://developer.android.com/resources/samples/NFCDemo/index.html

The demo does not even give you the ability to download the source
code!!!

The demo is very generic and is not a working application.

In order to be a full demo developers must have access to a sample NFC
tag or reader.  Does anyone have any recommendations for a tag/reader
they have actually used in creating a demo for NFC on Android 2.3?

On Jan 18, 3:11 am, Gorka gork...@gmail.com wrote:
 Hi,

 I´ve been working on NFC with my Samsung 5230 mobile, and now I am
 considering to move to Android. Before I do that I have some
 questions. I´ve been reading the group and the developers web page,
 but still have some doubts.

 - Is it possible to read MIFARE DESFire tags using the standard API.
 In order to do that I have always used the JSR 257 spec. but I don´t
 know if it is possible to do something similar with the current
 Android version.

 - Suppose that I have a tag that is a sticker always affixed to the
 mobile phone. Is it possible to read it always my application is
 started?? In the mobile I used to work with it was a limitation since
 once the sticker was detected the first time it could not detect it
 anymore until I removed the sticker from the mobile NFC range and got
 it close again. Would be possible using Android API to detect it
 anytime I start the app without having to remove it??

 - I am working on JavaCard too and I have developed an applet in order
 to complete the authentication steps in a secure way. Is it possible
 to access JavaCard applets in my SD card using Android API. Until that
 moment I have used the JSR 177 (APDU Connection, ...) in order to do
 that. The problem with others mobile is that to access the SD you have
 to sign your midlet with a Verysign certificate, but I don´t want to
 do this.

 Thanks a lot.
 Best regards.

--
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%2Bunsubs
 cr...@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] NFC doubts. JSR 257 - 177

2011-01-18 Thread Gorka
Hi,

I´ve been working on NFC with my Samsung 5230 mobile, and now I am
considering to move to Android. Before I do that I have some
questions. I´ve been reading the group and the developers web page,
but still have some doubts.

- Is it possible to read MIFARE DESFire tags using the standard API.
In order to do that I have always used the JSR 257 spec. but I don´t
know if it is possible to do something similar with the current
Android version.

- Suppose that I have a tag that is a sticker always affixed to the
mobile phone. Is it possible to read it always my application is
started?? In the mobile I used to work with it was a limitation since
once the sticker was detected the first time it could not detect it
anymore until I removed the sticker from the mobile NFC range and got
it close again. Would be possible using Android API to detect it
anytime I start the app without having to remove it??

- I am working on JavaCard too and I have developed an applet in order
to complete the authentication steps in a secure way. Is it possible
to access JavaCard applets in my SD card using Android API. Until that
moment I have used the JSR 177 (APDU Connection, ...) in order to do
that. The problem with others mobile is that to access the SD you have
to sign your midlet with a Verysign certificate, but I don´t want to
do this.

Thanks a lot.
Best regards.

-- 
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: Create Image from String

2010-10-08 Thread Gorka
Hi,

I've been doing some tests and apparently the problem is not in the
drawable, but in the way I create the InputStream.

file_handle = new RandomAccessFile(payload.file(), r);
file_handle.read(result);
String output = new String(result);

ImageView img = (ImageView)
this.findViewById(R.id.DTNApps_DTNReceive_ImageView);

byte[] bytes = output.getBytes();
InputStream in = new BufferedInputStream(new
ByteArrayInputStream(bytes));



Where am I doing something wrong?? Do I have to indicate any encoding
string (output.getBytes(US-ASCII) or something??

On 7 oct, 12:55, Gorka gork...@gmail.com wrote:
 Hi,

 I am trying to depict on the screen the image I receive from my
 neighbour via a text message. I mean, the other node sends me a
 message where an image is encode (I can read the PNG header, ...) and
 now I want to show it on the screen, but it doesn't appear nothing. I
 must be doing something wrong ¬¬.

 Here is my code:

 ImageView img = (ImageView)
 this.findViewById(R.id.DTNApps_DTNReceive_ImageView);

 byte[] bytes = input.getBytes(US-ASCII);
 InputStream in = new BufferedInputStream(new
 ByteArrayInputStream(bytes));

 Drawable drw = Drawable.createFromStream(in, src);
 img.setImageDrawable(drw);

 As I said, nothing appears on the screen. The img hsa a correct value
 since I try
 img.setImageDrawable(getResources().getDrawable(R.drawable.sample_0));
 and shows the picture.

 Can anyone help me??

 Bye and thanks for your time.

-- 
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] Create Image from String

2010-10-07 Thread Gorka
Hi,

I am trying to depict on the screen the image I receive from my
neighbour via a text message. I mean, the other node sends me a
message where an image is encode (I can read the PNG header, ...) and
now I want to show it on the screen, but it doesn't appear nothing. I
must be doing something wrong ¬¬.

Here is my code:

ImageView img = (ImageView)
this.findViewById(R.id.DTNApps_DTNReceive_ImageView);

byte[] bytes = input.getBytes(US-ASCII);
InputStream in = new BufferedInputStream(new
ByteArrayInputStream(bytes));

Drawable drw = Drawable.createFromStream(in, src);
img.setImageDrawable(drw);


As I said, nothing appears on the screen. The img hsa a correct value
since I try
img.setImageDrawable(getResources().getDrawable(R.drawable.sample_0));
and shows the picture.

Can anyone help me??


Bye and thanks for your time.

-- 
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 send a photo over Bluetooth

2010-07-01 Thread Gorka
Hi,

Thank you, it seems that is exactly what I wanted. I have not tested
it but apparently it works. By the way, I saw there is not an specific
function defined by the FileInputStream class to know the number of
bytes of the picture; do you know how can I get this value. I mean, I
am using this code:

FileInputStream f;
byte[] message_byte_array = new byte[512];

Log.d(TAG, Sending photo);

try {
  f = new FileInputStream(/sdcard/DCIM/Camera/prueba.jpg);
  int i = f.read(message_byte_array);

 

  f.close();
}


Read returns the number of bytes read, but there is any way to know
this number before to create the byte[] array accordingly??


Once again thanks for your time, Gorka.


On 29 jun, 13:36, Naoto naoto.kan...@gmail.com wrote:
 Hi,

 I happened to have written something similar just recently.  How about
 just opening the file with FileInputStream and use read() to read out
 the byte[]?  On the receiver end, you just write() with
 FileOutputStream.  Or did you just want tosendthe pixel data from
 memory to memory?

 I hope this helps.

 On 6月29日, 午後5:55, Gorka gork...@gmail.com wrote:

  I am sorry that I forgot to say that the photos are in JPEG format

  On 29 jun, 09:26, Gorka gork...@gmail.com wrote:

   Hello,

   I am trying tosendaphotofrom my Android device to a laptop via
  Bluetooth. Right now I have a gallery on the screen where the photos
   are depicted. What I want to do is to click aphotoand directlysend
   it to the laptop. All theBluetoothstuff works fine but what I don´t
   know how to do is to get the byte[] that conforms the picture that
   should be sent. Maybe that is not the way is supposed to be done, so
   please it would help if someone gives me some suggestions about how to
   proceed. I just need some guidelines, later I will investigate how to
   code everything. Once theBluetoothmessages reach the laptop is there
   something to do to rebuild the picture??

   And secondly, by now I am copying the files to the drawable file of my
   project. Is it possible to directly get them from the folder where the
   picturea I take are stored??

   Thank you very much for your help. Gorka



-- 
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 send a photo over Bluetooth

2010-07-01 Thread Gorka
Ups, there is the available function. I was reading the wrong API,
xD.

On 1 jul, 08:44, Gorka gork...@gmail.com wrote:
 Hi,

 Thank you, it seems that is exactly what I wanted. I have not tested
 it but apparently it works. By the way, I saw there is not an specific
 function defined by the FileInputStream class to know the number of
 bytes of the picture; do you know how can I get this value. I mean, I
 am using this code:

 FileInputStream f;
 byte[] message_byte_array = new byte[512];

 Log.d(TAG, Sending photo);

 try {
       f = new FileInputStream(/sdcard/DCIM/Camera/prueba.jpg);
       int i = f.read(message_byte_array);

      

       f.close();

 }

 Read returns the number of bytes read, but there is any way to know
 this number before to create the byte[] array accordingly??

 Once again thanks for your time, Gorka.

 On 29 jun, 13:36, Naoto naoto.kan...@gmail.com wrote:

  Hi,

  I happened to have written something similar just recently.  How about
  just opening the file with FileInputStream and use read() to read out
  the byte[]?  On the receiver end, you just write() with
  FileOutputStream.  Or did you just want tosendthe pixel data from
  memory to memory?

  I hope this helps.

  On 6月29日, 午後5:55, Gorka gork...@gmail.com wrote:

   I am sorry that I forgot to say that the photos are in JPEG format

   On 29 jun, 09:26, Gorka gork...@gmail.com wrote:

Hello,

I am trying tosendaphotofrom my Android device to a laptop via
   Bluetooth. Right now I have a gallery on the screen where the photos
are depicted. What I want to do is to click aphotoand directlysend
it to the laptop. All theBluetoothstuff works fine but what I don´t
know how to do is to get the byte[] that conforms the picture that
should be sent. Maybe that is not the way is supposed to be done, so
please it would help if someone gives me some suggestions about how to
proceed. I just need some guidelines, later I will investigate how to
code everything. Once theBluetoothmessages reach the laptop is there
something to do to rebuild the picture??

And secondly, by now I am copying the files to the drawable file of my
project. Is it possible to directly get them from the folder where the
picturea I take are stored??

Thank you very much for your help. Gorka



-- 
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 send a photo over Bluetooth

2010-06-29 Thread Gorka
Hello,

I am trying to send a photo from my Android device to a laptop via
Bluetooth. Right now I have a gallery on the screen where the photos
are depicted. What I want to do is to click a photo and directly send
it to the laptop. All the Bluetooth stuff works fine but what I don´t
know how to do is to get the byte[] that conforms the picture that
should be sent. Maybe that is not the way is supposed to be done, so
please it would help if someone gives me some suggestions about how to
proceed. I just need some guidelines, later I will investigate how to
code everything. Once the Bluetooth messages reach the laptop is there
something to do to rebuild the picture??

And secondly, by now I am copying the files to the drawable file of my
project. Is it possible to directly get them from the folder where the
picturea I take are stored??

Thank you very much for your help. Gorka

-- 
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 send a photo over Bluetooth

2010-06-29 Thread Gorka
I am sorry that I forgot to say that the photos are in JPEG format

On 29 jun, 09:26, Gorka gork...@gmail.com wrote:
 Hello,

 I am trying to send a photo from my Android device to a laptop via
 Bluetooth. Right now I have a gallery on the screen where the photos
 are depicted. What I want to do is to click a photo and directly send
 it to the laptop. All the Bluetooth stuff works fine but what I don´t
 know how to do is to get the byte[] that conforms the picture that
 should be sent. Maybe that is not the way is supposed to be done, so
 please it would help if someone gives me some suggestions about how to
 proceed. I just need some guidelines, later I will investigate how to
 code everything. Once the Bluetooth messages reach the laptop is there
 something to do to rebuild the picture??

 And secondly, by now I am copying the files to the drawable file of my
 project. Is it possible to directly get them from the folder where the
 picturea I take are stored??

 Thank you very much for your help. Gorka

-- 
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] RfComm channel using listenUsingRfcommWithServiceRecord

2010-05-07 Thread Gorka
Hi,

I am using listenUsingRfcommWithServiceRecord method to register my
service in the mobile. Apparently the rfcomm channel where the service
is registered is random, or at least it is not always the same.

Can I somehow force the channel to be associated always to a
particular RfComm channel?? That would be great in order to ease the
communication between the android and my Bluetooth device.

Thank you and regards

-- 
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