Barcode types supported by jasonette vision api - jasonette

I have a question regarding the $vision.scan action for scanning barcodes and hope someone could help me with that. Do we need to provide any particular option to be able to scan EAN 13 or EAN 8 barcodes? The example : (https://jasonbase.com/things/PMj7) is able to scan QR codes without any issues but isn't able to scan any other type of barcode. The gif in the $vision.scan documentation shows that a number of different types of barcodes are being scanned. Could it be a version issue? I'm using a Oneplus 5, running Android 8.1.0. Any help would be really appreciated.

Yes, you need to change some code in Android Studio.
In App > Java > com.jasonette.seed > Service > Vision > JasonVisionService.java
Find setBarcodeFormats.
detector = new BarcodeDetector.Builder(context)
// .setBarcodeFormats(Barcode.QR_CODE)
.setBarcodeFormats(Barcode.EAN_13 | Barcode.EAN_8)
.build();
In the above example I've commented out the QR_CODE format and instead added my own to scan EAN_8 and EAN_13.
More info:
https://developers.google.com/android/reference/com/google/android/gms/vision/barcode/BarcodeDetector.Builder

Related

Scanning for Bluetooth Devices using Plugin.BluetoothLE but name is blank

I'm using the NuGet package Plugin.BluetoothLE v6.3.0.19 and I can scan for nearby devices but mostly the names are blank. A few devices show their names but most do not. I also cannot see the mac address of the device I'm looking for.
The scenario is that I know the device name but need to look up the mac for connecting.
As I check the devices I need to check the device.name to see if it matches the device I'm looking for. If found it will attempt to pair and connect.
I'm thinking this LE (Low Energy) version does not get the names from every device unless it broadcasts it. So maybe I need to request more info? If so I don't know how to do that with this plugin.
var adapter = CrossBleAdapter.Current;
adapter.ScanExtra(new ScanConfig { ScanType = BleScanType.Balanced });
var scanner = CrossBleAdapter.Current.Scan().Subscribe(scanResult =>
{
var x = scanResult.Device;
System.Diagnostics.Debug.Print($"{x.Name} - {x.Status} _ {x.ToString()}");
});
I am not very familiar with the BluetoothLE, but I found a course about the problem. I hope this can help you.
In addition, you can put the issue on this git. People who know the problem may help you.

How to display firebase data in a list in MIT App Inventor?

I am making an app in MIT App Inventor wherein I need to let users make new entries into the database and there should be a screen in my app where I can display all the entries in a list.
You can think of this as a feed mechanism similar to the feed systems of any social media app.
Sample data:
FirebaseDatabase
--id89677687
--name: randomname1
--randomdata: randomdata1
--id89748687
--name: randomname2
--randomdata: randomdata2
--id89836587
--name: randomname3
--randomdata: randomdata3
According to this data, I would want to display all the id fields and their subfields in the form of a list. Any help would be appreciated!!
Solved: I found inbuilt elements in the MIT App Inventor and also found multiple tutorials on fixing this issue.

GattDeviceService.FromIdAsync returns null

The problem of this Windows UWP code:
var devices = await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid(new Guid("00001520-1212-efde-1523-785feabcd124")));
GattDeviceService m_service = await GattDeviceService.FromIdAsync(devices[0].Id);
is that m_service is always null. The BLE device which contains gatt service with 00001520-1212-efde-1523-785feabcd124 UUID is paired (the device is visible in device manager with no exlamation mark).
How to fix it?
To insert following code to Package.appxmanifest:
<Capabilities>
<m2:DeviceCapability Name="bluetooth.genericAttributeProfile">
<m2:Device Id="any">
<m2:Function Type="name:heartRate" />
</m2:Device>
</m2:DeviceCapability>
</Capabilities>
R. Wang's can be the correct answer, but is very hard and maybe impossible to change the Package.appxmanifest correctly by hand.
In visual Studio in solution explorer right-click on Package.appxmanifest and select open.
Click capabilities and thick Bluetooth and save Packagemanifest (ctr+s).
If this is not the solution for your problem, than we need more of your relevant code to help.

how to use telegram API codes?

i registered in https://my.telegram.org/apps and got api_hash and api_id and public key ,now i want to use this function https://core.telegram.org/method/auth.sendCode
auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
---functions---
auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
Query example
(auth.sendCode "79991234567" 1 32 "test-hash" "en")
=
(auth.sentCode
phone_registered:(boolFalse)
phone_code_hash:"2dc02d2cda9e615c84"
)
d16ff372 3939370b 33323139 37363534 00000001 00000020 73657409 61682d74 00006873 e77e812d
=
2215bcbd bc799737 63643212 32643230 39616463 35313665 00343863 e12b7901
how can i use this query example?
and what is this binaries? ==> "d16ff372 3939370b 33323139 ...."
You can't directly start to send queries to Telegram. Creating api_hash and api_id is a basic step to start with Telegram API. Hope you know that Telegram uses its own protocol called 'MTProto'. You can get the detailed discription in Telegram's official website.
As per Telegram Protocol, the Client and Server shares the 'Authorization Key' (which is used for encryption and decryption) using Diffie-Hellman algorithm. For sample please see https://core.telegram.org/mtproto/samples-auth_key. After creating the authorization key successfully, we can start to call Telegram APIs which is called as RPC queries.
You can also refer https://github.com/ex3ndr/telegram-api for implementation.
The hexadecimal data in the example is nothing but the query made by following the algorithm.
You need to start from making a valid Telegram AuthKey.
The patterns and functions you build up along the way while doing this will help you towards building the rest of your Telegram API.
You can start with this here: https://stackoverflow.com/a/32809138/44080
And them work up, step by step until you have the AuthKey as described in these links
https://core.telegram.org/mtproto/auth_key
https://core.telegram.org/mtproto/samples-auth_key
Part of the problem you will initially face is the documentation.
Working through this step by step and getting familiar with the authors writing style is a big help too.

Linkedin - Get companies updates queries

I'm trying to create an app to read company updates, but I have a few queries. Please help...
I'm using LinkedIn api via Oauth authentication in R
Is there anyway to fetch more updates than the restriction (only allow fetch up to 250 updates or updates in the last 20 days whichever comes first) ?
Example code
https://api.linkedin.com/v1/companies/270126/updates?event-type=status-update&count=100&start=0 &oauth2_access_token={access_token}
Once I got the updateKey, I'm trying to fetch the comments and likes but it's returning NO return
Example code
https://api.linkedin.com/v1/companies/270126/updates/key=UPDATE-c270126-5951438751136768000/update-comments?event-type=status-update&oauth2_access_token={access_token}
https://api.linkedin.com/v1/companies/270126/updates/key=UPDATE-c270126-5951438751136768000/likes?event-type=status-update&oauth2_access_token={access_token}
From the company status-update, it's returning FALSE for is-commentable and is-likable? Is that why there are no result from Query 2. If so, is there anyway to change that setting?
'is-commentable' false '/is-commentable'
'is-likable' false '/is-likable'
Any help would be greatly appreciated!!!!
Linkedin developer - Reading Company Shares link
https://developer.linkedin.com/reading-company-shares
Try using the Share and Social Stream end point instead of the Companies end point like this:
https://api.linkedin.com/v1/people/~/network/updates/key=UPDATE-c270126-5951438751136768000/update-comments?oauth2_access_token={access_token}
The documentation is here:
https://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates
Also you can test different Linkedin API calls here:
https://apigee.com/console/linkedin

Resources