1

i'm using the Activity Starter on App Inventor 2 to send a string to a thermal printer for billing through a third party package. with this code: Blocks 1 enter image description here Blocks 2 enter image description here I've already tried to reach other packages but it seems like my app has restricted privileges and its intents get discarded.... (not sure about this)

I have already tried with other solutions like printershare and cloud printing but none of them works with my actual printer except for this service, which I am unable to call (described at this site) http://qsrtechnologies.com/aboutposdriver.html

is there a way to send a broadcast intent through App Inventor so that a third party app can receive it?

thanks for your help

Taifun
  • 6,165
  • 17
  • 60
  • 188

2 Answers2

0

The Extras block of the Activity Starter expects a list of lists, see also this example How to add a contact to the contact list and don't forget to call the ActivityStarter.StartActivity method.

You might want to learn more about lists and lists of lists...

Also use Do it to debug your blocks, in your case the global variable scontrino, see also tip 4 here Top 5 Tips: How to learn App Inventor

Edit: After reading the documentation on that link, I would try this enter image description here

Taifun
  • 6,165
  • 17
  • 60
  • 188
  • Thanks for the correction.. But the problem seems to me deeper... No intent calling third party apps is reaching them... Only system's ones and YouTube or chrome... Could it be because I need to install them in system folders? I'll apply your correction and try again as soon as I can. I'm a bit lost here – Gianmarco Cassedy Poggi Jul 18 '16 at 16:18
  • according to their documentation: _1. Create your ESC data, 2. Create an Android Intent using "qsrtech.posprintdriver/.printservice", 3. Add your ESC data as a “Data” extra, 4. Start the intent service, i.e. startService(theintent)_ this should work... – Taifun Jul 18 '16 at 16:24
  • i've tried but the app is unable to start the activity, even trying to start the main activity of qsrtech.posprintdriver produces error 601 activity not found. it looks like i don't have the permissions to reach third party apps – Gianmarco Cassedy Poggi Jul 18 '16 at 18:16
  • as you also can see [here](http://stackoverflow.com/a/23225204) this should work, you might want to EDIT your question and add a new screenshot of what you have tried...and if you get an error, it would help to tell us the exact error message... – Taifun Jul 18 '16 at 20:36
  • is there a way to send a broadcast intent like in java? – Gianmarco Cassedy Poggi Jul 19 '16 at 08:10
  • you started correctly and together with the changes (see again my answer) you could have done it directly in App Inventor – Taifun Jul 19 '16 at 13:28
  • No. Unfortunately it has been confirmed that App-inventor has problems with the managing of external intents as the apps it generates have limited privileges (don't know why). So the only way to work it out was interacting externally. – Gianmarco Cassedy Poggi May 14 '17 at 17:00
  • _"it has been confirmed"_? who confirmed what? – Taifun May 16 '17 at 01:34
  • "it has been confirmed" was intending that many users have faced my same problem and it seems to be a real issue, the only intent working is the opening of a webpage, even lauching youtube with their same own tutorial included in the documentation doesn't work on android 4.4 and 5.x and 6.x (i could test it only on these versions) – Gianmarco Cassedy Poggi Jun 21 '18 at 14:18
  • _"many users have faced my same problem and it seems to be a real issue, the only intent working is the opening of a webpage"_ sorry, but your statement is not correct... in case you have still issues, you might want to start a new thread in the [App Inventor forum](https://groups.google.com/forum/#!forum/mitappinventortest) to get more help – Taifun Jun 21 '18 at 19:36
0

I have finally worked it out in a different way... since App Inventor's activity starter seemed a bit limited, i set the app to write to a .txt file and had an external java app to detect when that file was edited to take its content and send it via an intent to the .printservice. Now it works flawless.