Issue with interacting with iPad accessory via Binding - Xamarin.iOS - xamarin

I have a Barcode scanner accessory to which the iPad docks on to, hence i need to interface with the accessory to scan for barcode and use it in my application. To accomplish this, i followed the steps as enlisted here
Xamarin Hep - Link
So I went on to create a "Binding" project, added the native library i.e. ".a" file , created the APIDefinition and Structs using Sharpie and finally added the Binding project reference to my application.
In the next step, when I tried to deploy the app to iPad, encountered the error with regards to Native Linking.
In order to fix this, i mentioned the "Framework" in the LinkWith file like:
[assembly: LinkWith ("libBarCodeScannerSDK.a", SmartLink = true, ForceLoad = false, Frameworks="ExternalAccessory")]
Having done all the things stated above, I was able to deploy the app.But I am unable to make my application work with the Barcode scanner accessory. When I check the status of the scanner, its always returned as "NotConnected".
I am clueless as to how to go about debugging this issue and getting it resolved. Do appreciate, if someone can give me pointers on this.
Thanks,
Sid

most (if not all) of external accessories must set UISupportedExternalAccessoryProtocols key inside the info.plist file, see the info.plist file that the native Xcode example that came with your scanner SDK has and copy the UISupportedExternalAccessoryProtocols section to your Xamarin's app info.plist file.
Hope this helps!

Related

No assemblyinfo.cs file created for an iOS sample application in Xamarin

I understand that to enable XAML compilation I am supposed to add a line to the assemblyinfo.cs
But where is it for the iOS project in forms?
I see this file created in the properties folder for Android but not for iOS?
You don't have an assemblyinfo.cs for iOS projects, it only exists in the Properties folder of the Android project.
Similar functionality for iOS exists in the Entitlements and Info.plist files, but the syntax is different.
If you need to add something to the assemblyinfo.cs then it's for the Android side only, there might be an equivalent for iOS, certainly for a new Xamarin Forms app there shouldn't be anything extra you need to add
This is not exactly correct, you still need something like AssemblyInfo.cs if you are going to force WebView to use the WKWebView instead of the default UIWebView and you need this to be declared outside any namespace, I don't think you can force this using the Entitlements but I may be wrong,
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows#performance

Duplicated Xcode project issue

I've duplicated my Xcode project - basically I'm creating an app with similar functionality but with different content. I duplicated the main folder and updated the names in the new project for the new app following a guide on Youtube that was on another thread, but when I updated the background of the storyboard for the new app, I've now seen it has changed the storyboard of the original app, so it must be using the same story file, or be linked somehow.
Please can someone suggest what I might have done wrong, or what I need to do when duplicating the project to avoid the same story file being used.
Please check the "Full path" of your file like shown below. Make also sure, that all your other files are linked correctly.

Accessing resources XML from another library project in Xamarin.Android

I am trying to create a Xamarin.Android Component to send to the Xamarin Component Store, and I need to bundle my Colors.xml with it, so it is accessible to everyone using my component. I am setting the build action for the Colors.xml tp "AndroidResource".
So I created an Android sample application, when I add a reference to my library project's dll, I am able to use the colors defined, my project compiles and it runs, but I get no intellisense on Xamarin Studio. So that would be a bad thing for anyone using my library, as they would not be able to even see that the colors are available to use. You can see in this picture the colors defined are not available in the suggestions box.
If I add the Colors.xml directly into my project, I get Intellisense support, like this:
Is there a way to achieve the same result above when adding just the dll reference? Did I do something wrong or Xamarin.Android/Xamarin Studio doesn't support this kind of scenario?
EDIT: To be clear, I know this is a problem with Intellisense not being able to pick up the values, but is there anything I can do to make it work?

Can't change the header of Hub control in Windows Universal app

I'm having problem with changing header of the Hub Control in Windows Universal app. I'm attaching screenshots so you would be able to see how it looks like.
As you can see at screenshot I changed header text to "Test Header" in XAML and I can see all changes in VS Designer. Problem is when I compile the app and deploy it on device or emulator because than header still contains default text "application name"...
What am I doing wrong?? I tried to creat new project, I was searching for "application name" string or some binding in my project but with no luck... :( Please help guys because I'm struggling with this for a few days now and I have no idea what to do.
Thanks in advance! Regards!
Remove the x:Uid="Hub" from the Hub control.
<Hub x:Name="Hub" Header="Test Header"/>
That way it won't redirect all your strings to the Strings\en-US\Resources.resw file (it is part of the shared project)
If you want to keep it in, then just edit that file and rename the key to anything you like.

Xcode 5 Link Document Type

Am following tutorial at
http://www.raywenderlich.com/1980/email-tutorial-for-ios-how-to-import-and-export-app-data-via-email-in-your-ios-app
To link a document type to my application so that my application is responsible for opening up of that document.
XCode 5 works very different... Under your Target, Info tab is a "Document Types" line... am not sure how to use this, is there a sample for me?
Thanks
I'm sure you've either figured this out or moved on, but a little tip for most of these tutorials: you can often download the completed code from the website. I did so, and loaded it up in Xcode 5.0, and it works fine. Here's a screenshot of the plist entries (that's under Resources/ScaryBugs-Info.plist) for Document and Export:
Another way to change the Document types in Xcode is via the Project Info (select the project in the Navigator, then the target in the projects and targets list, then the info tab). Here's a screenshot of what that stuff looked like for me:
Here's another very helpful link straight from apple support. Watch the screenshot they have under Example and literally replicate everything from this screenshot and just change their custom extension from catinfo to pdf, ttf, xml or whatever you like
NOTE: Make sure you test this on actual iphone / ipad and not on simulator.
https://developer.apple.com/library/ios/qa/qa1587/_index.html

Resources