Commit b5e324fe by Lee Munkyeong

Merge branch 'features/#467_does_not_show_profile_on_offline' into 'features/abcomm_sp6'

オフライン対応

See merge request !105
parents 43e99294 3855619c
......@@ -96,10 +96,18 @@ public interface ABookCommConstants {
Integer DM = 1;
Integer ALL = 2;
}
interface MESSAGE_TYPE {
Integer TEXT = 0;
Integer PHOTO = 1;
Integer VIDEO = 2;
Integer SYSTEM = 4;
}
Integer GROUP_REQUEST_ALL = 0;
}
interface SIZE {
Integer MAX_FAVORITE_COUNT = 100;
}
String FILE_SAVE_PATH = "/data/user/0/jp.co.agentec.abookplus.check/files/";
}
......@@ -11,6 +11,8 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.GET_TASKS" /><!-- ActivityManager.RunningTaskInfo -->
<uses-permission android:name="android.permission.WAKE_LOCK" /><!-- using PowerManager WakeLocks to keep processor from sleeping or screen from dimming -->
<uses-permission android:name="android.permission.READ_LOGS" /><!-- an application to read the low-level system log files. -->
......
package jp.agentec.abook.abv.cl.util;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
......@@ -17,6 +18,7 @@ import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.media.MediaMetadataRetriever;
import android.media.MediaPlayer;
import android.util.Base64;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
......@@ -433,4 +435,21 @@ public class BitmapUtil {
return bitmapList;
}
public static Bitmap convert(String base64Str) throws IllegalArgumentException {
byte[] decodedBytes = Base64.decode(
base64Str.substring(base64Str.indexOf(",") + 1),
Base64.DEFAULT
);
return BitmapFactory.decodeByteArray(decodedBytes, 0, decodedBytes.length);
}
public static String convert(Bitmap bitmap) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream);
return Base64.encodeToString(outputStream.toByteArray(), Base64.DEFAULT);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment