If you have the jar file of the project then you can do it easily, else you need to put the main code of the library into the src
folder and then use.
where can i get that file i read in the link i need jar file but i don't know how to get it please say where it is
in this lib
If it doesn't has, and if you need to use it, you have to create it, it's easy.
Step : 1
Download JAR
or AAR
or both file into your computer or laptop.
Step : 2 (In case of AAR
)
Change the file extension from .aar
to .zip
and open zip file and extract .jar
file.
Step : 3
Past your .jar
and .aar
file into lib folder.
path is : appinventor-sources/appinventor/lib
Step : 4
Add path of external libraries into build.xml
file.
Path is : appinventor-sources/appinventor/components/build.xml
Reference : see this
Step : 5
Add @UsesLibraries annotation into your code.
Example : @UsesLibraries(libraries = "example1.jar," + "example2.jar")
Reference: see this
The problem is he cannot get the .jar / .arr
file.
Where is the file in this git repository
you can search into maven or you can contact developer
Doing a quick search for the library gives me the following results. I'm not sure which version you need, but you can find out by reading the documentation.
what is it is it .jar file
okay i will try
yes now i got the .jar file ,
i added this code in components/build.xml as said in docs
<copy toFile="${public.deps.dir}/ucrop.jar" file="${lib.dir}/ucrop/ucrop-2.2.0-javadoc.jar" />
now i coded in java file as
package edu.hifiapps.Croppy;
import android.content.Context;
import android.util.Log;
import com.google.appinventor.components.annotations.;
import com.google.appinventor.components.runtime.;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleEvent;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.AndroidViewComponent;
import com.google.appinventor.components.runtime.ComponentContainer;
import com.google.appinventor.components.runtime.EventDispatcher;
import com.google.appinventor.components.common.PropertyTypeConstants;
import com.google.appinventor.components.common.YaVersion;
import com.google.appinventor.components.runtime.errors.YailRuntimeError;
import com.google.appinventor.components.runtime.util.AnimationUtil;
import com.google.appinventor.components.runtime.util.ErrorMessages;
import com.google.appinventor.components.runtime.util.NougatUtil;
import com.google.appinventor.components.runtime.util.YailList;
import java.io.File;
import com.google.appinventor.components.runtime.util.*;
import android.graphics.Bitmap;
import android.media.Image;
import android.net.Uri;
@DesignerComponent(version = 1, description = "this extension is used to make cropping easy made by
" +"hifi apps. contact here-<br><a href='https://sites.google.com/view/hifiappcoders' target='_blank'>website</a><br>
",
category = ComponentCategory.EXTENSION,
nonVisible = true,
iconName = "https://i.ibb.co/pnVG9xf/picture.png")
@SimpleObject(external = true)
public class Croppy extends AndroidNonvisibleComponent {
@UsesLibraries(libraries = "ucrop.jar")
private ComponentContainer container;
private Context context;
/**
* @param container container, component will be placed in
*/
public Croppy (ComponentContainer container) {
super(container.$form());
this.container = container;
this.context = container.$context();
}
}
and got error while compiling
please help
You need to put it above @DesignerComponent
annotation.
i will try
it worked
No. You cannot find jar
for every repo.
Then should I google it how to create .jar file
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.