7/22/2019 Android Studio Projects With Source Code
The FTC SDK can be downloaded from a GitHub repository. GitHub is a web-based version control company that lets individuals and organizations host content online. In order to access the FTC software, you will need to have a GitHub account. You can create one for free by visiting the GitHub website:
Downloading the Android Studio Project Folder
Once you have created a GitHub account, you can visit the FTC public repository for the FTC software:
Important note for advanced GitHub users: this tutorial assumes that the user is a novice with respect to using GitHub and the git version control software. If you are a GitHub power user, you can use git to create a local copy of the ftc_app repository. This document, however, does not explain how to use git to access the repository. It provides instructions on downloading the repository as a .ZIP file instead.
From the main repository web page, click on the “releases” link to jump to the Releases page for the repository. The Releases page should list the available software releases for the repository. The latest release should be displayed near the top of the page.
Each software release should include a Downloads section that you can use to download the software that you will need to program your robot.
Click on the Source code (zip) link to download the compressed Android Studio project folder.
Extracting the Contents of the Archived Project File
Once you have downloaded the archived (.ZIP) project file you can move this file to the location of your choice.
Before you can import the FTC project into Android Studio, you must first extract the contents of the archived project file. For Windows users, right mouse click on the file and select “Extract All” from the pop up menu. Windows should prompt you to select a destination for the extracted project folder. The dialog that appears should look similar to the one show in the figure below.
Highlight the suggested name for the destination folder (in the figure above, the suggested name is “ftc_app-2.00”) and change the destination folder name into something more user friendly. In this example, we will change the name of the destination folder to “mycopy”.
After you have renamed the destination folder, extract the contents of the archive to the folder. After the extraction process is complete, verify that the project folder was successfully extracted to its target destination.
Once you have successfully extracted the contents of the archived file, you are ready to import the FTC project into Android Studio.
Importing the FTC Project into Android Studio
In order to import the FTC Project, you will need to launch the Android Studio software on your computer. On the main Android Studio Welcome screen, select the option to “Import project (Eclipse, ADT, Gradle, etc.)” to begin the import process.
Android Studio should prompt you to select the project folder that you would like to import. Use the file browser in the pop up dialog box to locate and then select the folder that you extracted in an section of this document. Make sure you select the extracted project folder (and not the .ZIP file which might have a similar name to the extracted folder). Hit the “OK” button to import the selected project into Android Studio.
In the figure above the project folder called “ftc_app-2.00” is selected to be imported into Android Studio. It might take Android Studio several minutes to import the project. Once the project has been successfully imported, the screen should look similar to the one depicted in the image below.
Tesseract is a well-known open source OCR engine that released under the Apache License 2.0. In this tutorial, I’d like to share how to build the OCR library for Android, as well as how to implement a simple Android OCR application with it.
Tesseract Android ToolsTo build the Tesseract OCR library for Android, we can use the tesseract-android-tools provided by Google. Android Studio Projects With Source Code And Documentation Free DownloadGet the source code: Open README, and take the following steps: Note: if you are using NDK r9, the building will fail with the error: To solve it, open Application.mk, and add the following line: After successfully building the OCR library, you will get the class.jar in folder bin and relevant *.so in folder libs. If you can’t successfully build the source code, please download the jni.zip and copy all source code to your project folder. Android OCR Application
Create an Android project, and import the relevant libraries.
Android Studio Projects With Source Codes
To do OCR, we can create a class named TessOCR:
In the constructor, we need to check the directory tessdata. If it doesn’t exist, an exception will be thrown in init(). If you want to know why, read the source code:
Pretty simple! Now we can use three different ways to load images and do OCR:
Browsing images in gallery, and sending one image to the OCR application
In AndroidManifest.xml, add the following intent filter:
Decode the image URI:
Picking an image from gallery
Send the Intent for picking images, and decode the returned URI in onActivityResult:
Taking a picture from camera
To get high-quality images, attach the file path to the Intent:
Before running the Android OCR app, do not forget to download the relevant language data packages and push them to your phone storage.
Source CodeComments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |