Open varundeva opened 5 years ago
I guess the owner of the source code is busy these days. I'm looking forward to her.
@hazarbozkurt hey bro what are the exactly changes i need to do with this source?
I want exactly clone of WhatsApp sticker app by WhatsApp
On Fri 4 Jan, 2019, 7:26 AM Hari <notifications@github.com 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 .
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
Ok
On Fri 4 Jan, 2019, 10:29 AM Tushar <notifications@github.com 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 Hey bro plz solve my problem.. Whenever i placed my stickers links in json file its not showing in app.
Put link same as they showed in given Json file
On Fri 4 Jan, 2019, 8:39 PM Hari <notifications@github.com 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 Broo then how can i add my stickers to app?
@hariiprasad send me your json link.
@viztushar bro here is the link https://gist.github.com/hariiprasad/4a2eddc021f52d71c9f87914df8904c0
@viztushar sorry for late reply here is the raw link https://gist.githubusercontent.com/hariiprasad/4a2eddc021f52d71c9f87914df8904c0/raw/43862a5d343672a89912b8769017905621c5fac4/contents.json
https://whatsappaero.com/contents.json My json file works fine.
@hazarbozkurt broo where you added your own stickers links in json file???
@hazarbozkurt broo where you added your stickers link???
here:
@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?
The smallest mistake spoils everything. Can you try the sample json file?
@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...
@hazarbozkurt bro did you tried with your own stickers links in json file?
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 bro did you tried with your own stickers links in json file?
No yet
@hazarbozkurt bro i have downloaded and i checked.still its not working.Once you plz check with your stickers link
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 you are using my code?? Or you use just that part of the code in your app??
i fully use your StickerProvider class
other code is mine
Here Is My Download Sticker Code :
class DownloadSticker extends AsyncTask<String, Integer, List
@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();
}
}
Please tell me what you need exactly ?
So i give you
Here i stop
@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?.
@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.
@varundeva No i get same path at the save time and get time
@varundeva should i have send my code ?
@Naynesh-Patel try to log it all locations and find what's wrong
okay i send my log details
@hariiprasad just change base link for tryimage in adapter line 83.
This Is Where Save Sticker And Tray Image
@Naynesh-Patel now check which location you get in content provider. And then compare both links.
Both Time I Get Same Path
@viztushar my tray image link in json file i have tried these links
"tray_image_file": "https://raw.githubusercontent.com/hariiprasad/my-personal/master/emojis/icon.png",
@Naynesh-Patel this log of json object right??
You have to check my code line number 128 check that method how I log the url that WhatsApp need and then check to your url.
@hariiprasad still not working?? Check image is getting downloaded or not.
@viztushar bro there is no problem with the stickers when i placed tray image link that you have provided. but when i changed my tray images links its showing there's is a problem with this sticker pack
Yes it download as it is in our format
but right now i unable to locate my com.classyclub.whatsappsticker package in android/data folder
i also not found your package name folder in my device
it may be invisible ?
@hariiprasad then the image size is big may be.
@Naynesh-Patel you can't get that location in phone you have to use android studio to check the location. Google it or you can find that in tool or in the right bottom part.
@viztushar bro the image size is 96*96,7.36kb and png file
@hariiprasad I need to check then.
@viztushar Please give me hint how i can check in android studio wheter my file is downloade din com.classyclub.whatsappsticker/files/stickes_assests/... folder or not ?
okay i got it
@varundeva but i did not found any folder in your package name as well as in my package name
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