I have created a .p file using Libgdx particle editor by downloading libgdx-nightly-latest.zip using this https://www.youtube.com/watch?v=LCLa-rgR_MA tutorial. Now in my Android project i have added gdx.jar and gdx-backend-android.jar as external jar from Libgdx. I found the following code which are used in libgdx project:
ParticleEffect effect = new ParticleEffect();
FileHandle fileDir = Gdx.files.internal("data");
effect.load(Gdx.files.internal("data/myParticleTxtFile"), fileDir);
effect.start();
effect.draw(batch, Gdx.graphics.getDeltaTime());
batch.end();
I modified the above code as follows in onDraw() method
ParticleEffect effect = new ParticleEffect();
FileHandle fileDir = Gdx.files.internal("asset");
effect.load(Gdx.files.internal("asset/myParticleTxtFile.p"), fileDir);
effect.start();
effect.draw((Batch) canvas, Gdx.graphics.getDeltaTime());
((Batch) canvas).end();
After debugging the code it is giving null pointer exception Gdx.files.internal("asset") here.I can understand that it is not getting any asset folder but how solve this and how draw particle effect in onDraw() using that .p file in android??