I am using phonegap to select images from device's photo gallery.The code I am using is
onclick="pickFromPhotoGallery(pictureSource.PHOTOLIBRARY)"
and
function pickFromPhotoGallery(source){
navigator.camera.getPicture(getImageURI, function(){}, { quality: 50,
destinationType: destinationType.FILE_URI,
sourceType: source });
}
This allows me to select only one image at a time. I want to select multiple images at a time.
Is there a way to do this please?
Thanks.
No, there is currently no way to do this. Please open an enhancement request on JIRA.
https://issues.apache.org/jira/browse/CB
Related
I am writing an android ftp server app and i need to select multiple files...i used the Intent.putExtra() method with EXTRA_ALLOW_MULTIPLE and it is working fine...But i need to select multiple files from different folders..Like, i want to choose 2 files from dir1 and 3 from dir2... It isn't allowed..i can choose multiple files from a single folder but not multiple folders...How can i solve this?
This is my code:
Intent filechooser= new Intent(ACTION_OPEN_DOCUMENT);
filechooser.setType("*/*");
filechooser.addCategory(Intent.CATEGORY_OPENABLE);
filechooser.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
try {
startActivityForResult(filechooser, 10);
}catch(Exception e){
Log.i("err",e.getMessage());
}
Any and all comments and answers are appreciated :)
There is no option for that — or, more accurately, the behavior of the ACTION_OPEN_DOCUMENT UI and whether it allows what you want is up to Android, and stock Android does not support this.
In your own UI, you can allow the user to execute that code snippet several times, where you build up the roster of files from multiple responses.
I was using android studio for last three months but when I moved to codename one I cant get a idea as everything seems so different and I don't know where to begin. I want to choose image from gallery on button click and upload it to a server.Can you help me shai ?
It's actually much simpler than Android:
MultipartRequest request = new MultipartRequest();
request.setUrl(url);
request.addData("myFileName", fullPathToFile, "text/plain")
NetworkManager.getInstance().addToQueue(request);
Taken from the JavaDoc here: https://www.codenameone.com/javadoc/com/codename1/io/MultipartRequest.html
I have an android application and I show courses (Mathematics,Physics,History and so on...).
I use android pdfView by Yoan Zapata using pdf documents but its not show as good,clear even in zooming, professional as digischool apps course content show.
How can I show my courses content like bac 2016 or brevet 2016 apps by digischool.
This is exemple of cours in digischool app
Thanks
What is your problem exactly ? Is the PDF low quality ? If so you can solve this by following this https://stackoverflow.com/a/32327174/4664754 wich basically explains you how to scale your rendering depending on the screen resolution of your device.
Here is the code presented in the link, but i highly recommand you to check directly the link as it is very well explained
Bitmap bitmap = Bitmap.createBitmap(getResources().getDisplayMetrics().densityDpi/72*mCurrentPage.getWidth() ,
getResources().getDisplayMetrics().densityDpi/72*mCurrentPage.getHeight(),
Bitmap.Config.ARGB_8888);
I have a problem, I can only create thumbnails of local video files but not of a remote url, here is my code:
bmThumbnail = ThumbnailUtils.extractThumbnail(ThumbnailUtils.createVideoThumbnail("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4", MediaStore.Video.Thumbnails.MINI_KIND), 50, 50);
I hope you can help me,
regards
christian
I suppose there is no easy way to build the thumbnail without actually downloading the video locally.
So if your question is 'Can I get a thumbnail without having to download the full video?', I'd say...no.
Otherwise, once you have downloaded the video locally, then I guess you can perfectly use ThumbnailUtils.createVideoThumbnail(...) by giving the path to the downloaded file.
I also have the same problem - but what can I say from my tests:
The problem occurs only on android >2.3
in android 2.0 -> 2.3 You can use just
Bitmap thumbnail = ThumbnailUtils.createVideoThumbnail( videoUrl, MediaStore.Video.Thumbnails.MINI_KIND);
I hope someone explain what change is on android 4. it doesn't work
I have no problem generating thumbnails from remote videos with the following code:
final Bitmap thumbnail = ThumbnailUtils.createVideoThumbnail( videoUrl, MediaStore.Video.Thumbnails.MINI_KIND );
You don't have to wrap an extractThumbnail() call around it
I am using the the gridView example from the developer.android.com site. But they are using images saved in the res/drawable folder. I want to try and set the images to come from my web server.
private Integer[] mThumbIds={
for(int i=0;i<myJSONArray.lenght();i++){
Object[] myJSONArray;
setImageDrawable(Drawable.createFromPath(String "www.mywebsite.com: + myJSONArray[i]).thumb);
};
};
Am I on the correct path to accomplish this? I am looking for advice or documentations/tutorials on this process. Thanks in advance.
I modified the GreenDroid library to do it for me - it has a nice set of imageloading classes. It takes some slight modification if you don't want to use their actionbar (I didn't see an easy way to do it without modification). Everything is also async : D !
this way you cant create Drawable from internet, for that you have first download content & make it Drawable refer this