1

I am currently trying to create an android library from one of my project classes and it depends on several downloaded libraries. Is this even possible to do with android?

I am currently using Android Studio version 2.1.2

My Class:

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import android.widget.ImageView;

import com.loopj.android.http.MySSLSocketFactory;
import com.neovisionaries.ws.client.WebSocket;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.security.*;
import java.util.ArrayList;
import java.util.List;

import javax.net.ssl.*;

import cz.msebera.android.httpclient.*;

public class AndroidRAPMXS {

    public String getMXSToken(String url, HttpClient httpClient, HttpPost post, String user, String pass) throws IOException, URISyntaxException {
    }

    public void addWebSocketHeader(String mxsLoginURL, WebSocket mxsWebSocket) {
    }

    public boolean joinMXSRoom(String mxsSessionId, WebSocket websocket, String token) {
    }

    public Bitmap getBitmap(String src) {
    }

    public String getImageURL(String messageReceived) throws JSONException {
    }

    public void setImageView(ImageView imgView,Bitmap bitmap) {
    }

    private class NullHostNameVerifier implements HostnameVerifier {
    }

}

I have tried to create a new android library module and creating a new class there and importing the libraries but when i build it i will get duplicate file errors.

benjababe
  • 91
  • 4

1 Answers1

0

So to create a library dependent on others i just created another project and imported a new Android library module, copied my class into it and imported all the required libraries. Then i followed this person's example and that gave out the jar file i needed

Community
  • 1
  • 1
benjababe
  • 91
  • 4