javandroid

1.1.5 • Public • Published

Javandroid

Create android apps using Java Runtime

Whats New

  • Version: 1.1.3

~ Fixed Keytool Generator Error!

~ Support For Android Support Packages And Library Resources

~ Fixed Regenerate R.java Errors

  • Version: 1.1.5

~ Custom packages

Dependencies

  • Java JDK: for java commands
  • Keytool: for generating keystores
  • AndroidSDK: for creating and building an Android Project

Installing

There are two methods how you can create you app!

The Class And The CLI

Install The Lib:

npm install javandroid

Install The Lib With The CLI

npm install -g javandroid

Note

Put your android support package jar file to libs folder

like support-appcompat.jar

Put the your library res file to libs-res folder

like res-appcompat

all java packages (.jar) is supported to be installed

I Will try making "build.jvd" just like build.gradle so you can install packages and edit building options... but not yet added

This didnt use any build tools like maven, gradle and apktool, this package uses SDK tools

SDK Tools Is Already Installed Inside the lib so the package size will be big

This tool was inspired from the NPM Package react-native And The NPM Package AndroidJS

the github links is from StevenArzt, FXTi, and lilicoding

Docs

Get all cli commands with javandroid help

CLI App Making

Lets start by making a project

javandroid init

It will show info questions to answer

lets change the platform version

javandroid platform 21

What is 21... its the api level or api version

Build It

After hours of coding you want to build it

Run this first before building!

javandroid registerInfo -n myproject

This registers your package infos from info.json, without it, it will show errors

Registering Project Info Will Help Some Commands To Identify What Project They will modify

Theres two types of signing the apk, Debug Or Release

Sign a debug app

javandroid build -r false -pn myproject

Sign A Release App

Release Apks Needs A Keystore

So Lets Generate One

javandroid keystore -g -pn myproject

It Will Create A Keystore In Your Projects Path

Now Lets Build It

javandroid build -r true -pn myproject

Check bin folder and boom your apk is builded

Theres Another Command Named regenerateRJava basically is will just regenerate your R.java this can also be used by error checking

javandroid regenerateRJava -pn myproject

Class App Making

Require The Package

const { Javandroid } = require('javandroid')

const javandroidMaker = new Javandroid()

Lets Generate Our Project

let config = {
        name: "myproject", // App name
        ver: "1.0", // App version
        min_sdk: "23", // App Min Sdk
        target_sdk: "29", // App Target Sdk
        package: "com.filipinoako.myproject" // App Package
}

javandroidMaker.generate(config)

Change The Platform Version

let ver = 21

javandroidMaker.changePlatform(ver)

After doing all codings, setting up, or something like that, Lets build it

Sign A Debug App

let appname = "myproject"
let release = false

javandroidMaker.build(appname, release)

Sign A Release App

So again lets generate a keystore

let options = {
        projectname: "myproject",
        validity: 10000,
        storepass: "myproject69420",
        keypass: "pass420"
}

javandroidMaker.generateKeystore(options)

Now lets build it!

let appname = "myproject"
let release = true

javandroidMaker.build(appname, release)

And BOOM You App.apk will be in the bin folder

Errors & Bugs

Upload it in stackoverflow and ill read and try to answer it!

LOL

im not that good in making README.md files 😂

Readme

Keywords

Package Sidebar

Install

npm i javandroid

Weekly Downloads

0

Version

1.1.5

License

MIT

Unpacked Size

3.05 MB

Total Files

37

Last publish

Collaborators

  • filipinoakoyoutube