Barcode lookups for games, books, CDs - c#

I am looking to write my own media library and was wondering are there any free .Net APIs out there to identify a product based on a given barcode? As a secondary point are there .Net APIs to return cover art for books, CD, games etc based on a barcode.

You can also use amazon web services for this. You'll need to have an account and API key (free) and download the toolkit for Visual Studio.
To answer your specific question, a barcode scan returns a UPC. You can use the ItemLookup command for the Amazon web service for this lookup, setting the IdType to "UPC" and the ItemId to the appropriate UPC (barcode scan).
For more info, navigate to the "API reference" in Amazon's developer guide.
Here is a very basic C# code sample:
com.amazon.webservices.ItemLookup itemLookup = new com.amazon.webservices.ItemLookup();
itemLookup.AWSAccessKeyId = "XXXXXXXXXXXXXXXXXXXXXX";
com.amazon.webservices.ItemLookupRequest request = new com.amazon.webservices.ItemLookupRequest();
request.IdType = com.amazon.webservices.ItemLookupRequestIdType.UPC;
request.ItemId = new String[] { "00028000133177" };
request.ResponseGroup = new String[] { "Small", "AlternateVersions" };
itemLookup.Request = new com.amazon.webservices.ItemLookupRequest[] { request };
try
{
com.amazon.webservices.ItemLookupResponse itemLookupResponse = com.amazon.webservices.AWSECommerceService.ItemLookup(itemLookup);
com.amazon.webservices.Item item = itemLookupResponse.Items[0].Item[0];
System.Console.WriteLine(item.ItemAttributes.Title);
}
catch (Exception e)
{
System.Console.Error.WriteLine(e);
}
Of note, I've written a program to do exactly this. I've found that Amazon does not always have a match for every UPC (which is expected), but a majority of my items are found in Amazon. Once you do find a match, you may want to store the ASIN / UPC relationship somewhere, so that you can reference the item by the ASIN (Amazon ID) going forward.

Try this: http://www.ozgrid.com/barcodes/barcode-reader.htm
EDIT1:
An API for the www.upcdatabase.com Barcode Query: http://www.upcdatabase.com/xmlrpc.asp
I cannot provide much information about this, but this might help you. This page has C# VB APIs for querying with a Barcode.

Hooked In Motion has one: http://www.hookedinmotion.com/?page_id=246

Related

Why does StoreContext.GetStoreProductsAsync(productKinds, storeIDs) get only current UWP app?

I have another UWP question.
I'm trying to get all the UWP apps that I published on the MS Store, but it seems there is something wrong: I can only get the current one beeing executed, although I insert many store IDs, the ones from my apps, as suggested by MS Docs.
Here's the code (of course, in my code I insert the real IDs):
StoreContext context = StoreContext.GetDefault();
string[] productKinds = { "Application" };
List<String> filterList = new List<string>(productKinds);
string[] storeIds = { "firstID", "secondID", "thirdID" };
StoreProductQueryResult queryResult = await context.GetStoreProductsAsync(filterList, storeIds);
if (queryResult.ExtendedError == null)
{
foreach (var product in queryResult.Products)
{
// Do something with 'product'
}
}
Well, it only returns one item, the current one.
Is there a way to obtain even other store apps?
Am I doing something wrong?
Thanks a lot.
GetStoreProductsAsync is only for the products associated with the app (i.e. add-ons):
Gets Microsoft Store listing info for the specified products that are
associated with the current app.
[docs]
To solve the problem you might want to look in the direction of Microsoft Store collection API and purchase API (requires web app setup in Azure).
Other than that StoreContext class at its current state doesn't contain API to get product information about other apps and their add-ons.

Couldn't get Apple Photos details - C# macOS Sierra 10.12 Xamarin Application

I'm developing an iMac desktop application which is able to upload normal photos as well as Photos library (Previously iPhotos library) to online services like Flickr,SmugMug. Before upgrading to Sierra i was able to get details of iPhotos and could upload too but after upgradation those files/directories doesn't exist.
Below is the block by which i was getting files:
string PhotosLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "Photos Library.photoslibrary/Database/apdb/Library.apdb");
But above is not working anymore in Sierra 10.12, if i go to finder itself to locate above mentioned path then i find 'Database' directory but no 'apdb' is there by which i can get Library.apdb
I have googled but no luck, can anybody please show me some pointers on how to get Photos Library files using C#.
Please tell me if i missed any information to share.
Thanks.
The Media Library Framework is the place to go if your situation permit.
NSDictionary<NSString, NSObject> options = new NSDictionary<NSString, NSObject>(
new[] { MLMediaLibrary.MediaLoadSourceTypesKey, MLMediaLibrary.MediaLoadIncludeSourcesKey },
new[] { new NSString(MLMediaSourceType.Image.ToString()), MLMediaSource.MediaSourcePhotosIdentifier }
);
var ml = new MLMediaLibrary(options);
ml.AddObserver("mediaSources", 0, (obj) => Console.WriteLine("Loaded"));
var src = ml.MediaSources; // returns null first time
In order to access MLMediaLibrary, your application has to be sandboxed and codesigned.
See also https://stackoverflow.com/a/29626032 to learn how to deal with entitlements.plist.

How to add a custom word list to inkrecognizer in uwp?

I have developped a uwp app that has a custom user control allowing handwriting recognition of the user input with a stylus into a textbox.
It works fine for common words, however my users often use technical terms and acronyms that are not always recognised or not recognised at all because they are not featured in the language I have set as the default recognizer for my InkRecognizer.
Here is how I set the default Inkrecognizer :
InkRecognizerContainer inkRecognizerContainer = new InkRecognizerContainer();
foreach (InkRecognizer reco in inkRecognizerContainer.GetRecognizers())
{
if (recognizerName == "Reconnaissance d'écriture Microsoft - Français")
{
inkRecognizerContainer.SetDefaultRecognizer(reco);
break;
}
}
And how I get my recognition results :
IReadOnlyList<InkRecognitionResult> recognitionResults = new List<InkRecognitionResult>();
recognitionResults = await inkRecognizerContainer.RecognizeAsync(myInkCanvas.InkPresenter.StrokeContainer, InkRecognitionTarget.All);
foreach (var r in recognitionResults)
{
string result = r.GetTextCandidates()[0];
myTextBox.Text += " "+result;
}
The expected results are generally not contained in the other textcandidates either.
I have read through the msdn documentation of Windows.UI.Input.Inking but haven't found anything useful on this particular topic.
Same goes for the Channel9 videos existing around handwriting recognition and the results that my google-fu have been able to conjure up.
Ideally, I'm looking for something similar to the WordList that existed in Windows.Inking
Is there a way to programatically add a wordlist to the pool of words of an Inkrecognizer or create a custom dictionary for handwriting recognition in a uwp app ?

QuickBooks Intuit IPP Issue Check

I am attempting to issue a check to a vendor through the Intuit.IPP API (Interop.QBFC12) using the following code:
IMsgSetRequest messageSet = session.CreateMsgSetRequest("US", 7, 0);
ICheckAdd cheque = messageSet.AppendCheckAddRq();
cheque.AccountRef.ListID.SetValue(vendor.ListID.GetValue());
cheque.AccountRef.FullName.SetValue("myAccountName");
cheque.TxnDate.SetValue(DateTime.Today);
IMsgSetResponse responseSet = session.DoRequests(messageSet);
IResponse response = responseSet.ResponseList.GetAt(0);
responseType = (ENResponseType)response.Type.GetValue();
if (responseType == ENResponseType.rtCheckAddRq)
returnMessage = response.StatusMessage;
The resulting response.StatusMessage = "Object 80000005-1374598713 specified in the request cannot be found. " The object ID specified is the ListID I pulled for the vendor.
I'm coding pretty much blind as I'm not finding the IPP documentation very helpful or up to date for version 12.
What am I missing?
This:
cheque.AccountRef.ListID.SetValue(vendor.ListID.GetValue());
cheque.AccountRef.FullName.SetValue("myAccountName");
Is what's causing you the problem.
The AccountRef node is for specifying an Account, not a Vendor. An Account is something from the QuickBooks Chart of Accounts (an "Account" object). A Vendor is something from the vendor list (a "Vendor" object) and they are not interchangable objects.
Since you're already setting an AccountRef/FullName:
cheque.AccountRef.FullName.SetValue("myAccountName");
You don't need to set a AccountRef/ListID.
You should always either set a ListID or a FullName - there's no reason to set both (it's just alternative ways to reference the same object - both are "foreign keys" of sorts to QuickBooks).
What you probably meant to do is set the AccountRef like you meant to, but also set the PayeeEntityRef. For example:
cheque.PayeeEntityRef.ListID.SetValue(vendor.ListID.GetValue());
Also, regarding this:
I'm coding pretty much blind as I'm not finding the IPP documentation
very helpful or up to date for version 12.
IPP is an entirely different API from what you're using. The IPP docs aren't going to be useful to you, because it's not anywhere close to the API you're using.
What you should be using for reference is the QuickBooks OSR:
https://member.developer.intuit.com/qbSDK-current/Common/newOSR/index.html
And also the QuickBooks SDK downloadable .EXE, which has a bunch of relevant PDF documentation.

facebooktoolkit and C# photo upload problem

I need help with integrating facebook into my desktop application. It's developed with C# - target framework is .NET framework 4.0.
I'm using http://facebooktoolkit.codeplex.com/
The problem is that I can't get the users albums although my app has permission for it, and for all to be more confusing I can get statuses, comments, friends, etc.
I have this in designer:
this.fbMyApp = new Facebook.Winforms.Components.FacebookService(this.components);
this.fbMyApp.ApplicationKey = "myappkey_goes_here";
this.fbMyApp.SessionKey = null;
this.fbMyApp.uid = ((long)(0));
And I've used this code(I've set all permissions for testing purposes):
fbMyApp.ConnectToFacebook(new List<Facebook.Schema.Enums.ExtendedPermissions>() {
Facebook.Schema.Enums.ExtendedPermissions.create_event,
Facebook.Schema.Enums.ExtendedPermissions.create_note,
Facebook.Schema.Enums.ExtendedPermissions.email,
Facebook.Schema.Enums.ExtendedPermissions.offline_access,
Facebook.Schema.Enums.ExtendedPermissions.photo_upload,
Facebook.Schema.Enums.ExtendedPermissions.publish_stream,
Facebook.Schema.Enums.ExtendedPermissions.read_mailbox,
Facebook.Schema.Enums.ExtendedPermissions.read_stream,
Facebook.Schema.Enums.ExtendedPermissions.rsvp_event,
Facebook.Schema.Enums.ExtendedPermissions.share_item,
Facebook.Schema.Enums.ExtendedPermissions.sms,
Facebook.Schema.Enums.ExtendedPermissions.status_update,
Facebook.Schema.Enums.ExtendedPermissions.video_upload
});
Now if I do this(after user has logged in):
MessageBox.Show("TOTAL statuses: " + fbMyApp.Status.Get().Count.ToString());
I will get the number of user statuses, and could read them. However if I do this:
MessageBox.Show("TOTAL albums: " + fbMyApp.Photos.GetAlbums().Count.ToString());
I get zero, although user has about 10 albums. I need this, cause this way I can access the album IDs and could be able to upload a photo to specific album. Any idea why this isn't working or does anybody have any better suggestion for some facebook toolkit for C#?
You need to request "user_photos" permissions from Facebook. I haven't used this toolkit as I prefer to make simple graph rest calls dynamically instead of having a huge library. I imagine you could download the source and recompile it, adding the missing permission. You could also switch to this library which is alot more up to date with current Facebook functionality.

Categories

Resources