Tesseract OCR In monotouch - iphone

How do I implement the Tesseract OCR in a monotouch application for Iphone?

First you need to have the library ported to iOS and available as a static library. That where Vikas' answer (Pocket-PCR) might comes handy (but I have not tried it).
Next you'll need to create C# bindings to the library.
When the API is exports C functions you can use normal .NET pinvokes, i.e. using DllImport attributes.
When an Objective-C API is provided then you can create bindings using the btouch tool. Instructions are available on the MonoTouch web site.
However (and this looks to be the case for Tesseract) it's a bit more complex for C++ libraries. You'll either need to first create a C (or Objective-C) library that export the feature you need and them bind your own API.

To build the tesseract library, download the source code and compile apropriately for the iPhone (arm processor). Add the library to the XCode project and build.
go this link and try ........
https://github.com/rcarlsen/Pocket-OCR

Related

using a third-party library's output directly in Swift

a friend of mine has developed a library, and I want to use it. I don't know how. His library is obfuscated as much as I know, his library is not in cocoa pod, and all I have is the build output of his library project. How can I use this library?

How to make shared logic usable for cross-platform native apps?

So I am currently using Xamarin for multi-platform mobile applications. I really like the way this works, and I want to improve my flow. My developers have said that they would be much faster when programming natively (i.e. Swift for iOS in XCode).
I have looked for a solution, where I can create a shared project and use it in native apps, but I have only found ways that involve programming in one language for all platforms.
Is there a way to create a shared project, which can be imported into a native application (or better, can be run together, like a shared project in Xamarin)?
The language for the shared code is not important, as long as it isn't slow.
My developers have said that they would be much faster when programming natively (i.e. Swift for iOS in XCode)
Swift can be used natively for iOS apps. RemObjects' Silver is supposed to make Swift ready for Android and .NET. I've never tested it. Try it out, it's free.
RoboVM can be used to write iOS apps in Java. I didn't try it out either.
Language mixing with Xamarin
In case you want to mix Swift code with C# code using Xamarin then you can bind Objective-C compatible Swift code and use it in iOS projects only. You are not able to execute Swift code on Android or Windows Phone! It's not possible to write platform independent business logic in Swift and and use it in a shared library or PCL with Xamarin.
You face the same restrictions for Java code on Android: You can bind JARs and use them in a Xamarin.Android project but you cannot use them on iOS or Windows Phone.
You are also unable to execute C# code in a Swift based app on iOS or in a Java based app on Android.
You can use native code in Xamarin apps via Binding Libraries. You cannot use Xamarin libraries in native apps.
If the goal is to use truly native tooling, in their standard languages (meaning not Xamarin) and still share code between iOS and Android, this can be achieved by writing your non-UI code in C++.
Here's a very interesting article about how Dropbox does exactly this.
C++ is natively supported on iOS and it is very easy to interface
between Objective-C and C++ using Objective-C++.
On Android, calling into C++ can be done through the NDK, which
reportedly is not a pleasure to use. Dropbox found Google’s meta-build
system gyp to work reasonably well. In addition, the Java Native
Interface is a pain you have to accept. But none of these issues is a
roadblock, and Steven expressed hope that Google or the community will
build better tooling support over time.
And here's a simple example of how to do this from another StackOverflow post

Linking C++ library to a view based application. [XCODE]

I am trying to link C++ based library file to an view based xcode project.
I am building a application for iPhone simulator.
So question is, is it possible to link C++ library to a objective-c project?
If yes then do I need to have an interface in between Objective-C code and the Library?
or can I use lib C++ functions/classes directly in the Objective-C class/methods.
Can some one please point to some good tutorials/examples to how to load a C++ based lib and use it in View based application in XCODE.
I have gone through this link:
http://www.eosgarden.com/en/articles/xcode-static-libraries/
There shouldn't be much you need to do. Have you renamed all files that uses the library to .mm? After that, everything should work the same. You can put C++ code on 1 line, then put Objective-C code the other line.

Are there any libraries or examples of how to handle OFX on the iPhone?

I'm working on a money-handling iPhone application and would like to interact with sources using the Open Financial Exchange (OFX) standard. Information about this standard is presented here and here.
Are there any open source libraries, examples, or tutorials out there about how to interact with OFX on an iPhone or in Objective-C?
I have no experience myself, but there's a C/C++ project named LibOFX which is open source - maybe it can be tweaked in using GCC Objective-C++?
Or, if you plan on writing your own Objective-C implementation, you can look into the code of OFX4J - a Java open source implementation of the OFX specification.
I haven't tried it as yet myself but there is a objective C library called OFXKit http://code.google.com/p/ofxkit/ that looks promising and supports versions 1.x and 2.x
Some further research shows that this library does not as yet support IOS due to a dependency on a Mac OS X utility.

Can I develop my own objective-C Framework for Cocoa Touch Applications?

Is it possible to create an own obj-C Cocoa Touch framework which can be used by other developers? And furthermore can you protect this framework?
I've created templates for Xcode 4 that allow you to build universal iOS frameworks (which work in both device and simulator).
Once the templates are installed, you simply select "Static iOS Framework" when creating a new project and it does the rest. It also works with unit tests.
https://github.com/kstenerud/iOS-Universal-Framework
You can create a static library. There is an option in the XCode project chooser to do this. You'll have to distribute the compiled static library file and the header files to users of your library. Your actual implementation files (.m) do not need to be distributed.
GHUnit does a good job of this - packaging up the libraries for both simulator and device - so I recommend looking at this project. (I also recommend using this library for unit testing :-)
The frameworks in Objective C are typically just C / ObjC code and a bunch of classes, nothing amazingly special. As such, you can create your own if you'd like, and then just include that in your project when you build it. The iPhone doesn't care about the difference, it just knows to put all that code into your app, along with everything else.
Have a look at the Framework Programming Guide on Apple's website. It will get you started. Essentially what you'll do is create a Framework project in XCode and then go from there.
As for "protecting" your framework, I assume you mean making your code unreadable. I'm not sure if and how you can do this, but perhaps Apple's guide will say something about it.
Yes you can create frameworks for use with Cocoa Touch.
However there are these caveats:
has to be a statically linked libary, no dynamic loading (dyld) for us
should be a combined (lipo) library for i386 (simulator), arm6 and arm7
you need to hack a bundle project into a framework
you should embed (small and few) images into the library so that the developer does not have to mess around with resources but just drags/drops it into his project
... or if you have large and many images build a bundle with these
I have guides for these things on my site.
1+2 = http://www.drobnik.com/touch/2010/04/universal-static-libraries/
The other links you have to google because this site does not let me post more than one URL.
You could make a static library available as binary (i.e. rudimentary "protection") to third parties, but not a dynamic one, as Apple's App Store policy prevents dynamic linking.
Take a look at a worked example for static libraries given at
this site
If you're going to do it, in my opinion JSON.framework is a great example to follow. To hide/obfuscate the source code is a different story, and a different question entirely,
When creating a new project, navigate to iOS > Framework & Library > Cocoa Touch Framework, it's as simple as that. When you are successfully compile, .framework will be created under Products folder in XCode. Right click to show in Finder, and you can find the output.
It's unlikely this will work the way you want it to because the other developers won't be able to use your framework. This StackOverflow Question explains why.