stickers-internet icon indicating copy to clipboard operation
stickers-internet copied to clipboard

Please Provide doc as well as some extra features details

Open varundeva opened this issue 6 years ago • 78 comments

I checked it working like boss add documentation or i tell me how to addd sticker pack details activity to it? now its now showing sticker publisher and etc information

varundeva avatar Jan 03 '19 09:01 varundeva

I guess the owner of the source code is busy these days. I'm looking forward to her.

hazarbozkurt avatar Jan 03 '19 12:01 hazarbozkurt

@hazarbozkurt hey bro what are the exactly changes i need to do with this source?

hariiprasad avatar Jan 04 '19 01:01 hariiprasad

I want exactly clone of WhatsApp sticker app by WhatsApp

On Fri 4 Jan, 2019, 7:26 AM Hari <[email protected] wrote:

@hazarbozkurt https://github.com/hazarbozkurt what are the exactly changes i need to do with this source?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/viztushar/stickers-internet/issues/6#issuecomment-451334601, or mute the thread https://github.com/notifications/unsubscribe-auth/AX8BPRRvYSGIbm_12LBed8tv45bfTt1cks5u_rTegaJpZM4ZnwCf .

varundeva avatar Jan 04 '19 03:01 varundeva

I'm too busy right now because of exam and other stuff so I'll do what all you want after I done with all stuff

viztushar avatar Jan 04 '19 04:01 viztushar

Ok

On Fri 4 Jan, 2019, 10:29 AM Tushar <[email protected] wrote:

I'm too busy right now because of exam and other stuff so I'll do what all you want after I done with all stuff

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/viztushar/stickers-internet/issues/6#issuecomment-451353854, or mute the thread https://github.com/notifications/unsubscribe-auth/AX8BPVBbS8CV538uXgSRz4GO-UTx3xKIks5u_t_IgaJpZM4ZnwCf .

varundeva avatar Jan 04 '19 05:01 varundeva

@varundeva Hey bro plz solve my problem.. Whenever i placed my stickers links in json file its not showing in app.

hariiprasad avatar Jan 04 '19 15:01 hariiprasad

Put link same as they showed in given Json file

On Fri 4 Jan, 2019, 8:39 PM Hari <[email protected] wrote:

@varundeva https://github.com/varundeva Hey bro plz solve my problem.. Whenever i placed my stickers links in json file its not showing in app.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/viztushar/stickers-internet/issues/6#issuecomment-451469803, or mute the thread https://github.com/notifications/unsubscribe-auth/AX8BPR8fypsbTmw7mH_4unGgYK0ytdlAks5u_26ggaJpZM4ZnwCf .

varundeva avatar Jan 04 '19 15:01 varundeva

@varundeva Broo then how can i add my stickers to app?

hariiprasad avatar Jan 04 '19 15:01 hariiprasad

@hariiprasad send me your json link.

viztushar avatar Jan 04 '19 15:01 viztushar

@viztushar bro here is the link https://gist.github.com/hariiprasad/4a2eddc021f52d71c9f87914df8904c0

hariiprasad avatar Jan 04 '19 16:01 hariiprasad

@viztushar sorry for late reply here is the raw link https://gist.githubusercontent.com/hariiprasad/4a2eddc021f52d71c9f87914df8904c0/raw/43862a5d343672a89912b8769017905621c5fac4/contents.json

hariiprasad avatar Jan 04 '19 17:01 hariiprasad

https://whatsappaero.com/contents.json My json file works fine.

hazarbozkurt avatar Jan 04 '19 17:01 hazarbozkurt

@hazarbozkurt broo where you added your own stickers links in json file???

hariiprasad avatar Jan 04 '19 17:01 hariiprasad

@hazarbozkurt broo where you added your stickers link???

here: 6ggclthosbccu_acvlvkva

hazarbozkurt avatar Jan 04 '19 17:01 hazarbozkurt

@viztushar sorry for late reply here is the raw link https://gist.githubusercontent.com/hariiprasad/4a2eddc021f52d71c9f87914df8904c0/raw/43862a5d343672a89912b8769017905621c5fac4/contents.json

Are you sure this part is right?

screenshot_5

The smallest mistake spoils everything. Can you try the sample json file?

hazarbozkurt avatar Jan 04 '19 17:01 hazarbozkurt

@hazarbozkurt yes it is correct bro .its just a single tray. i removed 2nd tray and i tried using sample json file also but didnt worked. i have replaced old json_link with my contents.json link in strings values also...

hariiprasad avatar Jan 04 '19 17:01 hariiprasad

screenshot 95 screenshot 96

hariiprasad avatar Jan 04 '19 17:01 hariiprasad

@hazarbozkurt bro did you tried with your own stickers links in json file?

hariiprasad avatar Jan 04 '19 17:01 hariiprasad

https://user-images.githubusercontent.com/42040267/50701275-4cf63c80-1073-11e9-9d3c-c9523d98c8b3.png

Before you can view sticker images, you must download them from the download button on the main screen.

(sorry for my bad English)

hazarbozkurt avatar Jan 04 '19 17:01 hazarbozkurt

@hazarbozkurt bro did you tried with your own stickers links in json file?

No yet

hazarbozkurt avatar Jan 04 '19 17:01 hazarbozkurt

@hazarbozkurt bro i have downloaded and i checked.still its not working.Once you plz check with your stickers link

hariiprasad avatar Jan 04 '19 17:01 hariiprasad

I Exactly done what you have done.

But at the end of the add sticker pack to whatsapp it throw exception FileNotFound.

private AssetFileDescriptor fetchFile(@NonNull Uri uri, @NonNull AssetManager am, @NonNull String fileName, @NonNull String identifier) { try { File file; if(fileName.endsWith(".png")){ // file = new File(getContext().getFilesDir()+ "/" + "stickers_asset" + "/" + identifier + "/tray/", fileName); file = new File(Environment.getExternalStorageDirectory()+ "/" + "stickers_asset" + "/" + identifier + "/tray/", fileName); } else { file = new File(Environment.getExternalStorageDirectory()+ "/" + "stickers_asset" + "/" + identifier + "/", fileName); } if (!file.exists()) { Log.d("fetFile", "StickerPack dir not found"); } Log.d("fetchFile", "StickerPack " + file.getPath()); return new AssetFileDescriptor(ParcelFileDescriptor.open(file,ParcelFileDescriptor.MODE_READ_ONLY), 0L, -1L); } catch (IOException e) { Log.e(Objects.requireNonNull(getContext()).getPackageName(), "IOException when getting asset file, uri:" + uri, e); return null; } }

This Line Throw FileNotFound Exception

return new AssetFileDescriptor(ParcelFileDescriptor.open(file,ParcelFileDescriptor.MODE_READ_ONLY), 0L, -1L);

Please help me

Naynesh-Patel avatar Jan 06 '19 09:01 Naynesh-Patel

@Naynesh-Patel you are using my code?? Or you use just that part of the code in your app??

viztushar avatar Jan 06 '19 10:01 viztushar

i fully use your StickerProvider class

other code is mine

Naynesh-Patel avatar Jan 06 '19 10:01 Naynesh-Patel

Here Is My Download Sticker Code :

class DownloadSticker extends AsyncTask<String, Integer, List<RowItem>> { List<RowItem> rowItems; int noOfURLs;

    @Override
    protected List<RowItem> doInBackground(String... urls) {
        noOfURLs = urls.length;
        rowItems = new ArrayList<RowItem>();
        Bitmap map = null;
        for (String url : urls) {
            map = downloadImage(url);
            rowItems.add(new RowItem(map));
        }
        return rowItems;
    }

    private Bitmap downloadImage(String urlString) {
        int count = 0;
        Bitmap bitmap = null;
        URL url;
        InputStream inputStream = null;
        BufferedOutputStream outputStream = null;
        try {
            url = new URL(urlString);
            URLConnection connection = url.openConnection();
            int lenghtOfFile = connection.getContentLength();
            inputStream = new BufferedInputStream(url.openStream());
            ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
            outputStream = new BufferedOutputStream(dataStream);
            byte data[] = new byte[512];
            long total = 0;

            while ((count = inputStream.read(data)) != -1) {
                total += count;
                publishProgress((int) ((total * 100) / lenghtOfFile));
                outputStream.write(data, 0, count);
            }
            outputStream.flush();

            BitmapFactory.Options bmOptions = new BitmapFactory.Options();
            bmOptions.outWidth=512;
            bmOptions.outHeight=512;
            bmOptions.inSampleSize = 1;

            byte[] bytes = dataStream.toByteArray();
            bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length, bmOptions);

            saveImage(bitmap, getLastBitFromUrl(url.toString()), stickerPack.identifier);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            FileUtils.close(inputStream);
            FileUtils.close(outputStream);
        }
        return bitmap;
    }

    @Override
    protected void onProgressUpdate(Integer... values) {
        progressBar.setProgress(values[0]);
        tvPercentage.setText(values[0] + "%");
    }

    @Override
    protected void onPostExecute(List<RowItem> rowItems) {
        rltPercentage.setVisibility(View.GONE);
        btnDownload.setVisibility(View.VISIBLE);
        btnDownload.setText("Add To Whatsapp");
        btnDownload.setBackgroundResource(R.drawable.download_complete_bg);
        isDownloaded = true;
    }
}

Here Is My Save Sticker To Internal Storage Code :

public String path;

public void saveImage(Bitmap finalBitmap, String name, String identifier) {

    String root = path + "/" + identifier;
    File myDir = new File(root);
    myDir.mkdirs();
    String fname = name;
    fname = name.replace(".png","")
            .replace(".jpg","")
            .replace(" ","_") + ".webp";
    File file = new File(myDir, fname);
    if (file.exists()) file.delete();
    try {
        FileOutputStream out = new FileOutputStream(file);
        finalBitmap.compress(Bitmap.CompressFormat.WEBP, 90, out);
        out.flush();
        out.close();

    } catch (Exception e) {
        e.printStackTrace();
    }
}

Naynesh-Patel avatar Jan 06 '19 10:01 Naynesh-Patel

Please tell me what you need exactly ?

So i give you

Naynesh-Patel avatar Jan 06 '19 10:01 Naynesh-Patel

screenshot 26

Here i stop

Naynesh-Patel avatar Jan 06 '19 10:01 Naynesh-Patel

@viztushar Hey broo... In stickerAdapter jave file when i replaced trayimage link with my link.. its showing error like [ There's is a problem with this sticker pack] . Can you resolve this?.

hariiprasad avatar Jan 06 '19 10:01 hariiprasad

@Naynesh-Patel I guess you are saving image some where else and find in somewhere so that's why you are getting that error.

First check all image are save in same direction/location as you find in context provider.

viztushar avatar Jan 06 '19 10:01 viztushar

@varundeva No i get same path at the save time and get time

Naynesh-Patel avatar Jan 06 '19 10:01 Naynesh-Patel