Category: "Android programming"
Recently, I am playing with OCR with Google ML Kit. A few years ago, I wish OCR in my mobile app, I want to extra some text from the images. That was very very hard to do. Either I need to use some opensource projector in a web server, and the app will post the image to my web api to do OCR. Or I need to buy some expensive libraries to do that. But Now, I can use Google ML Kit to do that. I just need to import library in gradle. And then I need to create an instance of TextRecognizer. Finally, I need to call a method with the image to do the OCR. I can use do that on the device or with CloudAPI. If I choose to do that on the device, that is completely free. Even I use the cloud API, I got first 1,000 users are free. That is a good deal. That is a good choice for an indie developer as myself
Last weekend, I started to migrate my old projects to the latest Android Studio. That is not a smooth process, first error I got is "Could not determine the class-path for interface com.android.builder.model.AndroidProject". I believe that caused by the old grade. I got a tip smart from Android Studio saying I should upgrade the version from 0.22 to 2.3.0. So I modified the classpath in the build.gradle file
Then I still got the same error. After I did some research on the internet. I found to upgrade the gradle. I need to change gradle-wrapper.properties too.
That is to get the latest package.
In your development option, you pick an app to mock your GPS location. I used this way to pretend I was in Hong Kong to test some apps for my clients in Hong Kong. But I found after that, even I switched off that GPS mocking. I found some funny behaviors. I turned on the navigation in Google map. Yes, at the first, GPS position is right, back to Australia, not in Hong Kong anymore. But my car was driving, the GPS position won't update. After I turned off my phone and turn it back on again. Then that is normal. I think after mocking GPS position, you need to reset the GPS. I know some apps can do.
I put every fragment with their own FAB Button. I found that is always placed under the last element of that layout. It won't be pushed further bottom, at the right bottom of the screen. I used to use the LinearLayout and RelativeLayout, they won't work too.
FInally, I found android.support.design.widget.CoordinatorLayout is only way to work, I don't know why yet, I found this solution by trial and error
Last night, I upgraded my android studio from 1.2 to 1.4. I have used android studio for more than a year. In old time, that was still in beta. Every upgrades, I needed to fixes the project files. This times, that was hassle-free, it only required to download 2GB files for library and sdk update. That is great. I love it.