OCR Framework that can read text from images in iOS? - objective-c

I'm currently starting a project right. One of the requirements is to read details of a "Cheque" .Meaning to say, the app should be able to read the account number, amount, etc of a certain "Cheque".

There is a similar question here
I tried something ago and works fine. Check the open source project called tesseract and also a demonstration here (with source code)

Related

How to create new sample library in LINQPad

I am trying to figure out how to write a sample library in LINQPad.
Went on the official website and tried to google arround as well but couldn't find anything.
I am working on a small framework library for work and I would like to showcase the usage of the framework via some samples. I don't want to publicly distribute the samples, just want to be able to send them to other developers I am working with.
Any idea ?
In the latest beta, you can create a sample library just by right-clicking a folder in My Queries and choosing Create sample library.
You can find some sample library .zip files here:
LINQPad Sample Libraries
Just unzip them and look at the contents.
It looks like all you have to do is just zip up a folder full of LINQPad scripts, and provide a header.xml file in the root of the zip file containing something like this:
<SampleLibrary>
<Name>Name of your sample library</Name>
</SampleLibrary>
If you check the contents of some those libraries on that web page you'll notice that they also bundle the libraries used in the zip file, you should consider doing this as well so that the people you send the library to don't have to fix references in any of the samples before trying them.

How to internationalize an iPhone App

I am trying to internationalize an iPhone app that was written few years ago and at that time unfortunately internalization was not the priority. As there are lot of nib files I have used ibtool to programmatically generate the nib files for each country. After running the ibtool utility i had to open up the project.pbxproj file and had to insert manual entries for the spanish language. Since i have to update lot of entries i did not choose this route.
I wanted to know how can i generate region specific nib file and have the entries reflected in the project.pbxproj file.
Secondly, I was unable to use gestrings option as the code doesn't use the NSLocalized method every where the text the is hard coded. while i prefer this option is there a safe mechanism to find out all the strings in the code base that can be internationalized?
Apologies for the long question. Any recommendations on how should i go about internationalizing the app?
Regards,
I solved this problem recently and came across the following links iphone-applications-localization-guide and ibtool-localization and Merging-changes-into-a-localized-nib-file
maybe it will help you.

Force a specific localization to be used for a target

I'm developing an app that, among other things, will play a large audio file (30MB).
I want to submit the app to the App Store in several countries. The audio file is different per target country, the rest of the app remains the same (Although localized).
I've created a target for each country, a bash script takes care of copying the correct audio file into compiled app based on the target, and it works great.
I've also localized the ressources (Images and Localized.strings) to make it easy to maintain.
Let's say I built my target for Sweden, I want to include only the swedish localization to force the app to always show swedish language (Which matches the audio file).
Here's the actual question:* How do I exclude all localizations from a target or force a target to ONLY use a specific localization, regardless of phone settings?
Based on your comment in answer to Lvsti (where you say the reason you're doing this is that translations in some of your languages aren't finished yet but you want to release what you have), perhaps as an alternative to deleting all the relevant localization files or messing with your build settings you can try to edit the list of languages in your XCode project? It's not per target but per project, but it might allow you to exclude languages you don't want in your build. See under Localizations in your project settings (there's a little - icon you can use to remove a language).
I think you might be able to pull it of by going to:
Target Settings => Info => Add a new row called Localizations => Add a new element to that array with the kind of language you want (I think the default is english)
I haven't tested it, just let me know if it worked.
If I understand your question, you don't actually need a localized app, or at least not a fully localized one. If that is the case, I would use a run-script build phase which is responsible for copying the appropriate non-localized but target-specific resources based on the current target. E.g. supposing you have an Audio folder in your project root with all the versions for the different languages, your script could look like:
cp "$PROJECT_DIR/Audio/$TARGETNAME.mp3" "$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/audio.mp3"
which would e.g. copy/rename "Swedish.mp3" to "audio.mp3" directly accessible from the bundle.

Is it possible to hook the API call that puts text on Mac OS?

There's a program called PPStream which is currently only available in Chinese, it allows for access to a myriad of ad-supported movies and TV series. The problems is that it is in Chinese and menus are indecipherable.
Is it possible to hook into the part of Mac OS's API that puts text on the screen so that it routes it through a wordlist first, translating the text into English? Would the API hook be able to differentiate the different applications calling the API?
I have no experience at all with Mac APIs, just pondering on if this is worth pursuing or not.
Thanks.
Edit: The reason I would like to do this at API level is that I need to dynamically dispatch HTTP queries with a list of strings to be translated (movie titles Chinese -> English), and the edit-the-i18n-file approach wouldn't do. Any other suggestions?
I haven't downloaded, installed or run PPStream myself so I'm speaking "out of my rear end" in a sense, but there are a number of ways to localize an app. But you really need to have access to the raw, uncompiled code and project to do it correctly.
The three most likely ways the string resources are saved are these:
1)
The app may have a strings file from which it fetches the strings to be displayed in the interface.
You may be able to make a copy of this strings file and set it to English or whatever language you choose.
2)
The strings may be baked into the code itself. This is generally a NO NO for commercial grade MacOS & iOS apps, but lazy and/or inexperienced developers can do this especially if they don't think their app will ever be used in other languages.
3)
The most likely set up is that there will be a folder hidden in the application package, inside the "Resources" folder, that has named like "en.lproj" or "English.lproj" or "de.lproj" or "zh_CN.lproj" or "zh_TW.lproj" (these last two are especially likely if this is only in Chinese).
Inside those folders will be localized XIB (or older NIB) files. And if you make a copy of this folder and then modify the newly made copy to add your new language.
Options 1 & 3 are ones you might be able to copy and then modify, but then again it might not work (especially these days when there's code & app signing). I've never tried this without an accompanying project, so if you have success, you should comment your question and/or this answer and let us know.

Best way to share code between multiple projects in iOS

We're planning to launch a serie of applications in AppStore. They will be for some kind of different journals, showing different contents downloaded from a server via XML. So these applications will be made from exactly the same code (It's an universal application, so It'll work both in iPhone/iPad).
My initial idea was, in order to upload the application, compile just changing the images, logos and configurations (plist) that makes the application react as a particular journal. The compressed file would be uploaded to the AppStore.
However, this has resulted a horrible method, which promotes failures and mistakes. If I forget to change some image, as you can't see them in the compiled file (as it is included) they will end up in the store (and I will need four or five days in order to get the application changed).
I'm trying to look up for a better approach, wich keep the projects as independent as possible. I would like to be able to share the entire codebase: views, classes and nibs and create different projects for every journal.
Which is the best method to achieve that?. What structure would let me group both logic (controllers, classes) and UI and use it in the different projects?.
I hope I've explained.
As always, thank you very much.
You should keep most of your common code as a library project. Each final project should link with this project and provide images/assets along with code to mention these assets to common code. In my day job, I write a common library too, which gets used by 2 products/apps at my employer.
An Xcode project can have multiple Targets, all the Targets sharing code, but each Target getting its own resources (icons, images, text, plists, etc.) from a different subdirectory/folder within the same project directory/folder. Then you can check the whole thing, or just the shared source, into your source control repository.
You should also be testing each of your apps, built exactly the same way as any submission except for the codesigning, on a device before uploading to the store.
You can have a single Xcode project that creates multiple applications. You'll need to create a separate Info.plist with a different bundle identifier for each app.
If you are using a git repository you can just branch for each different app you want and that would keep track of all the differences and if you need to switch which you are working on you just have to checkout that branch. This would allow for the exact same structure just minor differences between the actual code for each.