How can I improve/make changes to the orginal Gluo

2019-03-06 01:00发布

I am using Gluon Mobile so that I can use javafx to build applications to iOS and Android. I wonder how I can change/improve on the existing Charm Down library of services that are available: http://gluonhq.com/products/mobile/charm-down/

In my case specifically I need to take images that cover the whole screen on mobile. How can images taking up the whole screen be taken on Android and iPhone? And so I am looking to make edits to the VideoService and the PicturesService. By altering and building onto these existing services I hope to avoid alot of work that has already been done.

How can I edit existing services in Charm Down and use it in my app?

1条回答
相关推荐>>
2楼-- · 2019-03-06 01:20

If you check the Charm Down repository overview, you will find the required instructions for building your own version.

These are the requisites in case you want to fork Gluon Charm Down and build your local version:

  • A recent version of JDK 8
  • Gradle 2.2 or superior.

To build the Android Services:

  • Android SDK: the android SDK must be downloaded. The required Android platform is android-25.

  • ANDROID_HOME has to be defined as an environment variable, typically by adding it as a gradle property to ~/.gradle/gradle.properties.

  • Extras/Android Support Repository and Extras/Google Repository that can be installed with the Android SDK Manager.

To build the iOS Services:

  • A Mac with with MacOS X 10.11.5 or superior
  • XCode 8.x or superior

Once you have the above requisites, clone the repository from here:

hg clone https://bitbucket.org/gluon-oss/charm-down

(You might need to sign in in Bitbucket).

Open the project with your IDE.

Charm Down in NetBeans

Before modifying any of the services try to build it, install it and use them in your project.

To build the Charm Down services, on the project's root, run on command line:

./gradlew clean build

Build Charm Down

If you want to install them, run:

./gradlew clean install

When the process finishes successfully, the different services are installed in your local .m2 maven repository.

.m2

All these required jars can be added to a Gluon Mobile project by including mavenLocal() in the list of repositories and the snapshot version (currently 3.7.0-SNAPSHOT, but this could be changed as well):

repositories {
    mavenLocal()
    jcenter()
    maven {
        url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
    }
}

jfxmobile {
    downConfig {
        version = '3.7.0-SNAPSHOT'
        plugins 'display', 'lifecycle', 'pictures', 'statusbar', 'storage'
    }
}

test project

Tip: there are too many services that you don't want to modify, so you can comment out some of them from the settings.gradle file, mainly to reduce the building time.

Once everything is settled properly, you can start modifying the source code as you need. Anytime you want to check your changes, just run ./gradlew install and then deploy and run your project.

查看更多
登录 后发表回答