GithubHelp home page GithubHelp logo

hms-core / hms-image-vision-java Goto Github PK

View Code? Open in Web Editor NEW
22.0 13.0 6.0 124.14 MB

This sample code is to guide the developer how to integrate the Image Vision Sub-service of the Image Kit, calling the image filter function. This sub-service provides 24 unique filter effects to enhance the artistic conception and artistic sense of the images.

Home Page: https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/service-introduction-0000001050199011

License: Apache License 2.0

Java 100.00%
hms imagekit huawei image-editing photo picture android java

hms-image-vision-java's Introduction

HUAWEI Image Kit Vision Sample for Java

English | 中文

Table of Contents

Introduction

The Image Vision service : 1.Provides you with 24 color filters for scene-specific smart design. 2.Implements smart layout of images and texts for efficient content production. 3.Provides the sticker and text art function for image DIY. 4.Implements theme tagging for images and objects in images for convenient retrieval. 5.Implements image cropping for users to resize images.

Getting Started

  1. Check whether the Android studio development environment is ready. Open the sample code project directory with file "build.gradle" in Android Studio. Run TestApp on your divice or simulator which have installed latest Huawei Mobile Service(HMS).
  2. Register a HUAWEI account.
  3. Create an app and configure the app information in AppGallery Connect. See details: HUAWEI Image Service Development Preparation
  4. To build this demo, please first import the demo in the Android Studio (3.x+).
  5. Run the sample on your Android device or emulator.

Supported Environments

  • Android Studio 3.0 or later.

  • Java SDK 1.8 or later.

  • Android SDK version is 26 or later.

  • Gradle 3.3.2.

  • HMS Core (APK) 4.0.2.300 or later.

Result

Main Activity

Filter

Layout

ThemeTag

Sticker

Crop

Question or issues

If you want to evaluate more about HMS Core, r/HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.

If you have questions about how to use HMS samples, try the following options:

  • Stack Overflow is the best place for any programming questions. Be sure to tag your question with huawei-mobile-services.
  • Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.

License

ImageVisionSample is licensed under the Apache License, version 2.0.

hms-image-vision-java's People

Contributors

mike-mei avatar mukeshi1 avatar tiantian0303 avatar xuejiao-shi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hms-image-vision-java's Issues

在安卓11上运行调用滤镜api报错

--logversion:utracea
Process Name: 'com.godoperate.artistalbum'
Thread Name: 'main'
Back traces starts.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.godoperate.artistalbum/com.godoperate.artistalbum.ui.activity.OriginalGridActivity}: java.lang.SecurityException: getDataNetworkTypeForSubscriber
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3733)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3891)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2298)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:239)
at android.app.ActivityThread.main(ActivityThread.java:8142)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
Caused by: java.lang.SecurityException: getDataNetworkTypeForSubscriber
at android.os.Parcel.createExceptionOrNull(Parcel.java:2387)
at android.os.Parcel.createException(Parcel.java:2371)
at android.os.Parcel.readException(Parcel.java:2354)
at android.os.Parcel.readException(Parcel.java:2296)
at com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(ITelephony.java:8827)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3107)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3071)
at com.huawei.hms.image.visionkit.utils.CommonUtility.getNetworkClass(Unknown Source:8)
at com.huawei.hms.image.visionkit.ImageVisionApiService$IRemoteImageVisionApiImpl.saveContext(:2)
at com.huawei.hms.image.visionkit.aidl.IRemoteLocalApi$Stub.onTransact(Unknown Source:239)
at android.os.Binder.transact(Binder.java:1043)
at com.huawei.hms.image.vision.E$a$a.c(:5)
at com.huawei.hms.image.vision.ImageVisionImpl.b(:53)
at com.huawei.hms.image.vision.ImageVisionImpl.setVisionCallBack(:4)
at com.xiaopo.flying.puzzle.filter.HUAWEIFilter.init(HUAWEIFilter.java:40)
at com.godoperate.artistalbum.ui.activity.OriginalGridActivity.initFilter(OriginalGridActivity.java:127)
at com.godoperate.artistalbum.ui.activity.OriginalGridActivity.onCreate(OriginalGridActivity.java:121)
at android.app.Activity.performCreate(Activity.java:8119)
at android.app.Activity.performCreate(Activity.java:8103)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3706)
... 11 more
Back traces ends.
按照提示申请了android.Manifest.permission.READ_PHONE_STATE权限,运行不报错,但无法获取渲染的图片

ClassNotFoundException

E/ImageVisionImpl: ClassNotFoundException: Didn't find class "com.huawei.hms.image.visionkit.dynamic.FunctionCreator" on path: DexPathList[[zip file "/data/user_de/0/com.huawei.android.hsf/modules/external/huawei_module_imagevision/10003301/com.huawei.hms.image.visionkit-10003301.apk"],nativeLibraryDirectories=[/data/user_de/0/com.huawei.android.hsf/modules/external/huawei_module_imagevision/10003301/com.huawei.hms.image.visionkit-10003301.apk!/lib/arm64-v8a, /system/lib64, /hw_product/lib64, /system/product/lib64]]

我已经添加agconnect-services.json文件了,可能是混淆报错了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.