android-image

bad request while sending multiple images through retrofit 2.3.0 in android

不羁的心 提交于 2020-01-15 11:34:54
问题 I used to send multiple images to server through retrofit 2.3.0 , but I got bad request (400 err0r) my code: ArrayList<MultiPartImagesInputData> multiImagesList = new ArrayList<>(); String[] multiplesImages = {"originalImgBlob", "img430Blog", "img200Blog", "img100Blog", "blurResponseBlob"}; for (int i = 0; i < mFiles.size(); i++) { MultiPartImagesInputData multiPartImagesInputData = new MultiPartImagesInputData(multiplesImages[i], mFiles.get(i)); multiImagesList.add(multiPartImagesInputData);

android transition

瘦欲@ 提交于 2020-01-13 18:15:09
问题 I am using the following code to set an animation between 2 images for my SplashScreen: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); // Show A Transitions for Splash image here. TransitionDrawable transition = (TransitionDrawable) getResources() .getDrawable(R.drawable.splash_animation); //Set interval for the transition between two image. transition.startTransition(5000); //Fetch imageView from your layout and apply

Enlarging an Imageview on click

微笑、不失礼 提交于 2020-01-13 13:52:12
问题 Hello Stackoverflow friendo's. I'm just wondering if someone can assist me. I've created an app which holds a lot of images, the images are currently pretty small but I want them to expand once they're clicked. Is there any way of doing this? My app holds about 50 xml and the same in classes. But it holds about 100 images, is there any simple way to do this? An example of my XML <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

How to convert image to string in Android?

只愿长相守 提交于 2020-01-13 06:59:07
问题 It's my MySql DB Its encoding:- public String convertBitmapToString(Bitmap bmp) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); //compress to which format you want. byte[] byte_arr = stream.toByteArray(); String imageStr = Base64.encodeToString(byte_arr, 1); return imageStr; } This is decoding:- String img=o.toString(); byte[] imageAsBytes = Base64.decode(img.getBytes(), Base64.DEFAULT); imageView.setImageBitmap(BitmapFactory

How can I dynamically add images to a GridView?

强颜欢笑 提交于 2020-01-10 03:05:27
问题 I have a GridView that is created based on an array of items. I need to add more images as the grid is scrolled to the bottom, but I'm not sure how to do that. Now I do understand the following: I have an adapter which parses the array and provides ImageIds to the class that will return the ImageViews Somehow I have to change this array and let the adapter know about it, so my question is, how do I get a reference to this adapter? This is my code: package com.wm.grid; import android.app

How can I fill an ImageView in an Appwidget while mainiting the aspect ratio?

半腔热情 提交于 2020-01-06 08:21:28
问题 I have a simple widget containing an ImageView . I'd like to fetch an image from the web and display it in the ImageView while maintaining the aspect ratio. Here's the layout definition for the widget: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/quality_image" android:layout_width="fill_parent"

Canvas - null pointer exception

无人久伴 提交于 2020-01-06 06:41:07
问题 Sometimes, I am getting NullPointerException in the line. Please let me know how to correct this. At the time of error, I have checked the possibility for the null value in variable backgoundImage. The variable backgoundImage is not null. canvas.drawBitmap(backgoundImage, 0, 0 , null); Code: @Override public void run() { // TODO Auto-generated method stub ourHolder = getHolder(); while (isRunning) { if (!ourHolder.getSurface().isValid()){ continue; } canvas = ourHolder.lockCanvas();

How to access an image that is stored internally

眉间皱痕 提交于 2020-01-05 19:39:10
问题 I have an application that takes a picture and stores the picture internally in a folder that I have created. After taking a picture I want to be able to access it so that I can email it. How can I access the image I have just taken?Below is my code that saves the image internally after the picture has been taken: protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { Bundle extras =

How to access an image that is stored internally

丶灬走出姿态 提交于 2020-01-05 19:38:09
问题 I have an application that takes a picture and stores the picture internally in a folder that I have created. After taking a picture I want to be able to access it so that I can email it. How can I access the image I have just taken?Below is my code that saves the image internally after the picture has been taken: protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { Bundle extras =

ListView shows wrong and duplicates images

喜欢而已 提交于 2020-01-03 16:37:18
问题 I have a ListView and 12 ImageViews in it. Every ImageView has different image which is loading from url. Images are shuffled and sometimes duplicated either I scroll or not. I tried 10 other ways to solve this problem but have not succeeded. This is the code I download and show images: private static class ViewHolder { ImageView imageViewPhoto; Bitmap photo; boolean isDownloading; } @Override public View getView(final int position, View convertView, ViewGroup parent) { final ViewHolder