Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Receiving Android intents from other apps
Started by pucman68 Oct 29 2019 12:53 AM

3 replies to this topic
intent
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

pucman68

[GLOBAL: userInfoPane.html]
pucman68
  • Enthusiast

  • 48 posts
  • Corona SDK

Hello,

 

i need to create a barcode scanner app on a real scanner device which has a build in laser scanner.
The device is broadcasting a system intent with the scanned data as payload.
Is there any way to receive this data in a Corona based app ???

 

Here is a link to the documentation from the vendor of the device.
https://techdocs.zebra.com/datawedge/6-3/guide/output/intent/

 

Thx in advance

Andreas



[TOPIC: post.html]
#2

xnailbender

[GLOBAL: userInfoPane.html]
xnailbender
  • Contributor

  • 362 posts
  • Corona SDK

pucman,

 

Sounds like a good project.  I would think it's possible to get the payload with Corona, but it would require a scanner tool in hand to figure out.

 

Nail



[TOPIC: post.html]
#3

pucman68

[GLOBAL: userInfoPane.html]
pucman68
  • Enthusiast

  • 48 posts
  • Corona SDK

@Nail,

the problem is not the scanner tool, the problem is how to receive android intents.
As far as I undersood there is an system app running on the device which catches the hardware trigger (scanner) and
sends out an android intent as broadcast. If we where able to manage to receive any intent I am sure it would

work with the scanner as well.

 

Thx



[TOPIC: post.html]
#4

xnailbender

[GLOBAL: userInfoPane.html]
xnailbender
  • Contributor

  • 362 posts
  • Corona SDK

pucman,

 

from my little experience with Android intents, the only way I could get them to work was basically trial and error configuring the intent or intents, you can have more than one.

 

The reason a scanner is needed is to trigger the DataWedge intent and play with different intent configurations until your app either loads or is at least is shown as an option to open the payload in the list of apps presented in the dialog box.  If the DataWedge app has a simulated trigger to send an intent then that would be all you need to proceed.  I haven't downloaded the app yet, so not sure where to find this feature.

 

I have looked through some of the DataWedge documentation trying to find the mimeType of the payload.  It could be MSR or possibly NFC, I really don't know.

 

You may need a permission like this also,

<uses-permission android:name="android.permission.NFC" />

 

If you had a scanner in hand, you may also be able to see the intent pass into the logcat?

 

I got lost reading the documentation, but it looked like you may be able to load your app into a profile in the DataWedge app as a recipient of the output, but I didn't spend enough time to fully understand it.  I was focusing mainly on associating an app with an intent and mimeType.

 

Nail

 

 

 

Nail




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: intent