CopyPastor

Detecting plagiarism made easy.

Score: 1.754910171031952; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2019-01-24
by milad salimi

Original Post

Original - Posted on 2016-08-13
by Riyaz Parasara



            
Present in both answers; Present only in the new answer; Present only in the old answer;

**You can convert your bitmap to byte array and save it in realm database.**
like this :
Bitmap bmp = intent.getExtras().get("data"); ByteArrayOutputStream stream = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); byte[] byteArray = stream.toByteArray();

Notice:Realm supports the following field types: boolean, byte, short, ìnt, long, float, double, String, Date and byte[]
**You can use [this][1] for realm configuration in android too.**

[1]: https://realm.io/docs/java/latest/
And you can convert **imageview** to **bitmap** by :
imageView.buildDrawingCache(); Bitmap bmap = imageView.getDrawingCache();
Please Read carefully Firstly convert image into ByteArray i am giving demo
Bitmap bmp = intent.getExtras().get("data"); ByteArrayOutputStream stream = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); byte[] byteArray = stream.toByteArray();

and then save byte[] into Realm database
Notice: Strings and byte arrays (byte[]) cannot be larger than 16 MB

Realm supports the following field types: boolean, byte, short, ìnt, long, float, double, String, Date and byte[]. The integer types byte, short, int, and long are all mapped to the same type (long actually) within Realm. Moreover, subclasses of RealmObject and RealmList are supported to model relationships.

        
Present in both answers; Present only in the new answer; Present only in the old answer;