You must create a CoinHive account
Get then your public Site key
This will be used to initialize your Monero Miner in Android.
How it works
MoneroMiner follows the Singleton pattern.
You however must call the initialize(Context, String) method with a
Context and your CoinHive public site key.
You can do this in the
onCreate() method of your
Use the Monero Miner
Once the initialized, you can freely call the
start() method to run the Monero Miner. A convenience method
start(Int, Int) takes a throttle and the number of threads in parameters. When not used anymore, call the
You can change the number of threads the Monero Miner runs on (default is 1). Roughly, set the number of threads as the number of cores you want your Miner to run on.
You can change the throttle of the Monero Miner (default is 20). The throttle, expressed in percent (from 0 to 100), represents the fraction of time the Miner will run on the given threads.
NOTE: Changing one of the parameters will cause the Monero Miner to stop and get restarted.
Windows Defender is known to block the use of the Monero Miner script onto your Windows distribution. If you get an error when starting or initializing the miner stating that it cannot find a reference to
coinhive.js, make sure you have desactivated Windows Defender first.
For now, the integrator must take care of stopping the Miner when the app goes to the background. A further improvement may be to make this automatically. Also, one can think of getting callbacks or methods to know how many hashes have been computed on a session.
This SDK is under the MIT license.
This Monero Miner was proudly made at Smart&Soft, Paris FRANCE