Android Question Motorola TC55... Barcode scan with Intents..BroadcastReceiver..

Discussion in 'Android Questions' started by Cüneyt Gargin, Aug 5, 2015.

  1. Cüneyt Gargin

    Cüneyt Gargin Member Licensed User

    Hi....
    I am developing an Android application on Motorola TC55 Android devices. I can adjust device (i.e. DataWedge Application) to broadcast intent. Please check image. And I write an B4A Application. (please check zip file). I have one main module and a service module. And I use Broadcast_Receiver....

    When I scan a barcode, normally, it is expected that device sends intent and my started service is triggered on BroadcastReceiver_onReceive event. But it does not...

    I send broadcast from main module and onReceive event is triggered. I debug application and see it receives broadcast.

    My questions are :
    1. Is there any mistake I make while setting up device ?
    2. When I send broadcast from main module, service gets this broadcast.. does it mean there is problem with my adjustments =
    3. Is there any mistake I make in my code , in my service or manifest editor ?

    B.R.
    Cuneyt
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Is there any Java documentation about these intents?
     
  3. Cüneyt Gargin

    Cüneyt Gargin Member Licensed User

  4. Erel

    Erel Administrator Staff Member Licensed User

    You should configure the intent delivery mode to be broadcast intent and choose whichever action you like.

    Then add an intent filter with the manifest editor that will catch this action.
     
  5. Cüneyt Gargin

    Cüneyt Gargin Member Licensed User

    Erel Can you please check image file and zip file I posted.. Because I did as you said and I still could not manage to receive the broadcast.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    1. Remove the BroadcastReceiver library. You do not need it.
    2.
    As this is a broadcast intent you need to use:
    Code:
    AddReceiverText(WedgeService, <intent-filter>
      <action android:name=
    "scantest.BARCODESCAN" />
      <category android:name=
    "android.intent.category.DEFAULT" />
    </
    intent-filter>)
     
  7. Cüneyt Gargin

    Cüneyt Gargin Member Licensed User

    Thank you very much ... It did !!!!!!
    In StartingIntent of Service, I get barcode.. Thank you very much...
     
    Erel likes this.
  8. Cüneyt Gargin

    Cüneyt Gargin Member Licensed User

    Dear Erel, When I get the barcode in the service, It is there ... how can I pass this value to the activity which calls this service...
    i.e. I have an activity..in Activity_Create I start service... service starts listening to Barcode event.. when I scan a barcode, in startingIntent I can read barcode... but... I want this barcode to pass to an editText on the Activity.. How will I understand from activity that the service started and startingIntent event is fired.. So I can pass barcode value to editText.....
     
  9. DonManfred

    DonManfred Expert Licensed User

    you can use callsubdelayed2
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice