2016-11-15 10 views
-2

編集:画像ファイル(example.jpg)をbyteArrayに変換する方法がわかりません。どのように処理されているのか理解しようとしていますが、これまで何も得られていません。このサイトでは見つかりましたが、何も私のために働くようです。 ここで質問した結果、他の人の助けを借りてどのように処理されたのか理解できるかもしれません。Image from SD storage from ByteArray

私のSDカードに画像ファイルがあります。私は自分のパスを知っています。それはbyteArrayに、私はlogcatで間違った結果を得ているので、私はそうすると思います。私は、出力がどうあるべきかを確認していない

import android.content.Intent; 
import android.graphics.Bitmap; 
import android.graphics.BitmapFactory; 
import android.net.Uri; 
import android.os.Environment; 
import android.os.Handler; 
import android.os.StrictMode; 
import android.support.v4.app.FragmentActivity; 
import android.os.Bundle; 
import android.util.Base64; 
import android.util.Log; 
import android.view.View; 
import android.widget.Button; 
import android.widget.EditText; 
import android.widget.Toast; 

import com.google.android.gms.awareness.snapshot.internal.Snapshot; 
import com.google.android.gms.maps.CameraUpdateFactory; 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.OnMapReadyCallback; 
import com.google.android.gms.maps.SupportMapFragment; 
import com.google.android.gms.maps.model.Circle; 
import com.google.android.gms.maps.model.CircleOptions; 
import com.google.android.gms.maps.model.LatLng; 
import com.google.android.gms.maps.model.Marker; 
import com.google.android.gms.maps.model.MarkerOptions; 
import com.google.android.gms.maps.GoogleMap.SnapshotReadyCallback; 
import com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback; 

import java.io.ByteArrayOutputStream; 
import java.io.File; 
import java.io.FileInputStream; 
import java.io.FileNotFoundException; 
import java.io.FileOutputStream; 
import java.io.OutputStreamWriter; 
import java.util.Date; 
import java.util.Map; 

import static android.R.attr.bitmap; 
import static android.R.attr.duration; 

public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { 
    public byte[] B; 
    private GoogleMap mMap; 
    GPSTracker gps; 
    public File imageFile ; 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_maps); 
     // Obtain the SupportMapFragment and get notified when the map is ready to be used. 
     SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() 
       .findFragmentById(R.id.map); 
     mapFragment.getMapAsync(this); 

    } 


    /** 
    Create the map when the map is ready OnMapReady, The object GPS is ccalled (GPSTraccker) to obtain 
    Values for lat and long. 
    */ 
    final Handler handler = new Handler(); 

    @Override 
    public void onMapReady(final GoogleMap googleMap) { 
     mMap = googleMap; 

     // Add a marker in Sydney and move the camera 
     gps = new GPSTracker(MapsActivity.this); 
     double latitude = gps.getLatitude(); 
     double longitude = gps.getLongitude(); 
     LatLng sydney = new LatLng(latitude, longitude); 
     //adding an automated marker to mark the users spot on the map. 
     mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Cyprus")); 

     mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); 
     mMap.animateCamera(CameraUpdateFactory.zoomTo(19.0f)); 
     mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() { 
      //When the map is clicked the following will occure 

      @Override 
      public void onMapClick(LatLng point) { 
       //create a new marker on the new lat/long of the spot clicked 
       MarkerOptions marker = new MarkerOptions().position(
         new LatLng(point.latitude, point.longitude)).title("New Marker"); 
       //places the marker 
       mMap.addMarker(marker); 
       //create an object of Bitmap 
       Bitmap bitmap; 
       //Creating and calling object Snapshot 
       SnapshotReadyCallback callback = new SnapshotReadyCallback() { 
        @Override 
        //when the snapshot is ready do the following 
        public void onSnapshotReady(Bitmap bitmap) { 
        //Creating object Date and storing it to now 
         Date now = new Date(); 
         //Retribing exact date and storing it to now 
         android.text.format.DateFormat.format("yyyy-MM-dd_hh:mm:ss", now); 


         try { 
          //dissabling strick mode for testing , remember to remvoe this code 
          StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy(); 
          StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder(old) 
            .permitDiskWrites() 
            .build()); 

          //mpath = /sd/date.jpg creating a dir for the image to be snaped 
          String mPath = Environment.getExternalStorageDirectory().toString() + "/" + now + ".jpg"; 
          //Calling object File. 
          File imageFile = new File(mPath); 
          FileOutputStream out = new FileOutputStream(imageFile); 
          //outputing streaming to /imagefile 
          bitmap.compress(Bitmap.CompressFormat.PNG, 90, out); 

          Log.d("Var:OUT: ", " " + out); 
          Log.d("ImageFile" ,""+ imageFile) ; 
          Log.d("mPath" ,""+ mPath) ; 
          //decompose image 
          Bitmap bmp = BitmapFactory.decodeFile(mPath); 

          ByteArrayOutputStream stream = new ByteArrayOutputStream(); 

          StrictMode.setThreadPolicy(old); 
          ByteArrayOutputStream streams = new ByteArrayOutputStream(); 
          bmp.compress(Bitmap.CompressFormat.PNG, 100, streams); 


          bitmap.compress(Bitmap.CompressFormat.PNG, 90, stream); 
          byte[] image=stream.toByteArray(); 
          System.out.println("byte array:"+image); 
          Log.d("array", image.toString()); 
          String img_str = Base64.encodeToString(image, 0); 
          Log.d("array_Str",img_str); 
          System.out.println("string:"+img_str); 
         } catch (Exception e) { 
          e.printStackTrace(); 
         } 
        } 
       }; 

       mMap.snapshot(callback); 


       System.out.println(point.latitude + "---" + point.longitude); 


      } 
     }); 

    } 

    // public byte[] getBytesFromBitmap(Bitmap bitmap) { 
    //  ByteArrayOutputStream stream = new ByteArrayOutputStream(); 
    //  bitmap.compress(Bitmap.CompressFormat.JPEG, 90, now); 
    ////  Log.d("ARRAY", "" + now.toByteArray()); 
    // byte[] B = stream.toByteArray(); 

    //  return stream.toByteArray(); 

//} 





    public void onSnapshotReady (Bitmap bitmap) { 
     Date now = new Date(); 
     android.text.format.DateFormat.format("yyyy-MM-dd_hh:mm:ss", now); 
     Log.d("DOulefko","test"); 
     try { 
      // image naming and path to include sd card appending name you choose for file 
      String mPath = Environment.getExternalStorageDirectory().toString() + "/" + now + ".jpg"; 

      // create bitmap screen capture 
      View v1 = getWindow().getDecorView().getRootView(); 

      v1.setDrawingCacheEnabled(true); 
     bitmap = Bitmap.createBitmap(v1.getDrawingCache()); 
      v1.setDrawingCacheEnabled(false); 

      File imageFile = new File(mPath); 

      FileOutputStream outputStream = new FileOutputStream(imageFile); 
      int quality = 100; 
      bitmap.compress(Bitmap.CompressFormat.JPEG, quality, outputStream); 
      outputStream.flush(); 
      outputStream.close(); 

     } catch (Throwable e) { 
      // Several error may come out with file handling or OOM 
      e.printStackTrace(); 
     } 
    } 
    private void openScreenshot(File imageFile) { 
     Intent intent = new Intent(); 
     intent.setAction(Intent.ACTION_VIEW); 
     Uri uri = Uri.fromFile(imageFile); 
     intent.setDataAndType(uri, "image/*"); 
     startActivity(intent); 
    } 
} 

11-15 11(全体base64では含まない)私のlogcat:46:25.565 19702から19702/com.example.apostolis.gpsapi15 I/art:Late-enabling -Xcheck:jni 11-15 11:46:25.597 19702-19702/com.example.apostolis.gpsapi15 W/System:ClassLoader 参照先未知のパス: /data/app/com.example .apostolis.gpsapi15-1/lib/arm64 11-15 11:46:25.600 19702-19702/com.example.apostolis.gpsapi15 I/MultiDex:VM バージョン2.1.0にマルチデックスサポート11-15 11:46:25.600 19702-19702/com.example.apostolis.gpsapi15 I/MultiDex:install 11-15 11:46:25.600 19702-19702/com.example.apostolis.gpsapi15 I/MultiDex :VM にmultidexサポートがあり、MultiDexサポートライブラリが無効になっています。 11-15 11:46:25.603 19702-19702/com.example.apostolis.gpsapi15 I/FirebaseInitProvider:FirebaseAppの初期化に失敗11-15 11:46:25.616 19702-19702/com.example.apostolis.gpsapi15 W /アート: アンドロイド4.1の前に、方法android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter、 android.content.res.ColorStateList、android.graphics.PorterDuff $モード) android.graphics.drawable.Drawable 11-15 11:46:25.622 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state.preset のpackage-privateメソッドを間違ってオーバーライドしていました。 = false、color :0、半透明= 0 11-15 11:46:2 5.622 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state.preset = false、色:0、半透明= 0 11-15 11:46:25.622 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state.preset = false、色:0、半透明= 0 11-15 11:46:25.624 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state.preset = false、color: - 16777216、半透明= 0 11-15 11:46:25.629 19702-19702/com.example.apostolis.gpsapi15 V/BoostFramework: mAcquireFuncメソッド= public int com.qualcomm.qti.Performance.perfLockAcquire(int、int []) )11-15 11:46:25.630 19702-19702/com.example.apostolis.gpsapi15 V/BoostFramework:mReleaseFuncメソッド= public int com.qualcomm.qti.Performance.perfLockRelease()11-15 11:46: 25.630 19702-19702/com.example.apostolis.gpsapi15 V/BoostFramework: mAcquireTouchFuncメソッド= public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent、android.util.DisplayMetrics、int、int [] (int、java.lang.String) 11-15 11:46:25.630 19702-19702/com.example.apostolis.gpsapi15 V/ 11-15 11:46:25.630 19702-19702/com.example.apostolis.gpsapi15 V/BoostFramework:mIOPStopメソッド= public int com.qualcomm.qti.Performance.perfIOPrefetchStop()11-15 11:46:25.632 19702-19702/com.example。apostolis.gpsapi15 V/BoostFramework: BoostFramework():mPerf = [email protected] 11-15 11:46:25.632 19702-19702/com.example.apostolis.gpsapi15 V/BoostFramework:BoostFramework ):mPerf = [email protected] 11-15 11:46:25.655 19702-19702/com.example.apostolis.gpsapi15 D/AppTracker:Appイベント: start 11-15 11:46: 25.662 19702-19717/com.example.apostolis.gpsapi15 D/OpenGLRenderer:EGL_SWAP_BEHAVIOR_PRESERVEDを使用:11-15 11:46:25.667 19702-19702/com.example.apostolis.gpsapi15 D/AppTracker: Appイベント:stop 11-15 11:46:25.684 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state.preset = true、co lor:-16777216、半透明= 0 11-15 11:46:25.708 19702-19717/com.example.apostolis.gpsapi15 I/Adreno:QUALCOMMビルド
:19f8f74、Iac38d51750 ビルド日付:06/06/16 OpenGL ESシェーダコンパイラのバージョン:XE031.07.00.01 現地支店:case2489916_Unmap_crash リモートブランチ: リモートブランチ: 再構築支店:11-15 11:46:25.712 19702から19717/com.example.apostolis.gpsapi15 I/OpenGLRenderer : 初期化されたEGL、バージョン1.4 11-15 11:46:25.721 19702-19702/com.example.apostolis.gpsapi15 D/AbstractTracker:イベント 成功11-15 11:46:25.725 19702-19702/com.example.apostolis.gpsapi15 D/AbstractTracker:イベントの成功11-15 11:46:25.740 19702-19717/com.example.apostolis.gpsapi15 E/HAL:負荷: gralloc.msm8996.so 11-15 11:46:37.663 19702-19702/com.example.apostolis.gpsapi15 D/AppTracker:Appイベント: start 11-15 11:46:37.705 19702-19702 /com.example.apostolis.gpsapi15 D/AbstractTracker:イベントの成功11-15 11:46:38.715 19702-19702/com.example.apostolis.gpsapi15 D/LocationManager: requestLocationUpdates listener = com.example.apostolis。 [email protected] packageName = com.example.apostolis.gpsapi15 11-15 11:46:38.718 19702-19702/com.example.a postolis.gpsapi15 D/Network:Network 11-15 11:46:38.735 19702-19702/com.example.apostolis.gpsapi15 D/AppTracker: アプリケーションイベント:停止11-15 11:46:38.749 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state.preset = false、色:0、半透明= 0 11-15 11:46:38.749 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state。プリセット = false、色:0、半透明= 0 11-15 11:46:38.749 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state.preset = false、color:0、translucent = 0 11 -15 11:46:38.750 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state.preset = false、color:-16777216、半透明= 0 11-15 11:46:38.757 19702-19702/com .example.apostolis.gpsapi15 I/zzai:作成者 を動的に作成する11-15 11:4 6:38.797 19702-19702/com.example.apostolis.gpsapi15 W/System:ClassLoader 参照先未知のパス: /data/user/0/com.google.android.gms/app_chimera/m/0000000e/n/arm64 -v8a 11-15 11:46:38.818 19702-19702/com.example.apostolis.gpsapi15 W/f: StrictModeポリシー違反を抑制しました。StrictModeDiskReadViolation 11-15 11:46:38.822 19702-19702/com.example。 apostolis.gpsapi15 I/Google Maps Android API:Google Playサービスクライアントのバージョン: 9877000 11-15 11:46:38.826 19702-19702/com.example.apostolis.gpsapi15 I/Google Maps Android API:Google Playサービスパッケージバージョン: 10084448 11-15 11:46:38.832 19702-19702/com.example.apostolis。gpsapi15 W/F:抑制StrictModeポリシー違反: StrictModeDiskReadViolation 11-15 11:46:38.846 19702から19702/com.example.apostolis.gpsapi15 W/F:抑制StrictMode ポリシー違反:StrictModeDiskReadViolation 11-15 11:46 :38.857 19702-19702/com.example.apostolis.gpsapi15 W/f:抑制されたStrictMode ポリシー違反:StrictModeDiskReadViolation 11-15 11:46:38.880 19702-19702/com.example.apostolis.gpsapi15 W/f: StrictMode ポリシー違反:StrictModeDiskReadViolation 11-15 11:46:38.891 19702から19702/com.example.apostolis.gpsapi15 W/F:抑制StrictMode ポリシー違反:StrictModeDiskReadViolation 11-15 11:46:38.911 19702から1 9702/com.example.apostolis.gpsapi15 W/f:Suppressed StrictMode ポリシー違反:StrictModeDiskReadViolation 11-15 11:46:38.925 19702-19702/com.example.apostolis.gpsapi15 W/f:StrictModeを抑制しました ポリシー違反: StrictModeDiskReadViolation 11-15 11:46:38.939 19702-19702/com.example.apostolis.gpsapi15 W/f:StrictModeを抑制しました。 ポリシー違反:StrictModeDiskReadViolation 11-15 11:46:38.939 19702-19702/com.example.apostolis .gpsapi15 W/f:Suppressed StrictMode ポリシー違反:StrictModeDiskWriteViolation 11-15 11:46:38.960 19702-19702/com.example.apostolis.gpsapi15 W/f:StrictModeを抑制しました。 ポリシー違反:StrictModeDiskReadViolation 11-15 11:46 :38.989 19702-19702 /com.example.apostolis.gpsapi15 W/f:抑制されたStrictMode ポリシー違反:StrictModeDiskReadViolation 11-15 11:46:38.989 19702-19702/com.example.apostolis.gpsapi15 I/c: からロードされたトークン。有効期限:430122644 ms。 11-15 11:46:38.989 19702-19702/com.example.apostolis.gpsapi15 I/c:次のスケジュールは で429822秒になります。 11-15 11:46:39.018 19702-19702/com.example.apostolis.gpsapi15 W/f:抑制されたStrictMode ポリシー違反:StrictModeDiskWriteViolation 11-15 11:46:39.019 19702-19702/com.example.apostolis。 gpsapi15 W/F:抑制StrictMode ポリシー違反:StrictModeDiskWriteViolation 11-15 11:46:39.032 19702から19924/com.example.apostolis.gpsapi15 I/DpmTcmClient:com.android.okhttp.TcmIdleTimerMonitor 11-15:から RegisterTcmMonitor 11:46:39.073 19702-19954/com.example.apostolis.gpsapi15 W/f: StrictModeポリシー違反を抑制しました。StrictModeDiskReadViolation 11-15 11:46:39.074 19702-19702/com.example.apostolis.gpsapi15 W/f: StrictModeポリシー違反を抑制しました:StrictModeDiskReadViolatイオン 11-15 11:46:39.075 19702-19702/com.example.apostolis.gpsapi15 W/f: StrictModeポリシー違反を抑制しました。StrictModeDiskWriteViolation 11-15 11:46:39.083 19702-19702/com.example.apostolis .gpsapi15 D/AppTracker:Appイベント開始:11-15 11:46:39.090 19702-19702/com.example.apostolis.gpsapi15 D/PhoneWindow:state.preset = true、color:-16777216、translucent = 0 11-15 11:46:39.122 19702-19702/com.example.apostolis.gpsapi15 D/AbstractTracker:イベント 成功11-15 11:46:39.137 19702-19702/com.example.apostolis.gpsapi15 D/LocationManager: requestLocationUpdates [email protected] packageName = com.example.apostolis.gpsapi15 11-15 11:46:39 .140 19702-19702/com.example.apostolis.gpsapi15 D/Network:Network 11-15 11:46:39.182 19702-19702/com.example.apostolis.gpsapi15 D/AbstractTracker:イベントの成功11-15 11 :46:39.195 19702-19717/com.example.apostolis。gpsapi15 D/OpenGLRenderer:46:39.942 19702から19973/com.example.apostolis.gpsapi15のW/F:抑制StrictMode ポリシー違反:ハンドル 0x7f9b7feb80 11-15 11と0x7fa01fdc00(RippleDrawable)に endAllStagingAnimators StrictModeDiskReadViolation 11~15 11:46:40.120 19702-19702/com.example.apostolis.gpsapi15 W/f:抑制されたStrictMode ポリシー違反:StrictModeDiskReadViolation 11-15 11:46:40.121 19702-19702/com.example.apostolis.gpsapi15 W/f:Suppressed StrictMode ポリシー違反:StrictModeDiskWriteViolation 11-15 11:46:41.098 19702-19956/com.example.apostolis.gpsapi15 W/DynamiteModule:ローカル com.google.android.gms.googlecertificatesのモジュール記述子クラス が見つかりません。 11-15 11:46:41.115 19702-19956/com.example.apostolis.gpsapi15 I/DynamiteModule: ローカルモジュールcom.google.android.gms.googlecertificatesを検討する:0 とリモートモジュールcom.google.android.gms .googlecertificates:2 11-15 11:46:41.115 19702-19956/com.example.apostolis.gpsapi15 I/DynamiteModule: の選択されたリモートバージョンcom.google.android.gms.googlecertificates、version> = 2 11- 15 11:46:41.117 19702-19956/com.example.apostolis.gpsapi15 E/DynamiteModule:DynamiteLoaderの読み込みに失敗しました: java.lang.ClassNotFoundException:クラス が見つかりませんでした "com.google.android.gms。 Dynamite.DynamiteModule $ DynamiteLoaderClassLoader " パス上:DexPathList [[zipファイル "/data/app/com.example.apostolis.gpsapi15-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.apostolis.gpsapi15-1/lib/arm64,/vendor/lib64 、/ system/lib64]] 11-15 11:46:41.117 19702-19956/com.example.apostolis.gpsapi15 W/DynamiteModule:失敗しました リモートモジュールをロードする:モジュールコンテキストを取得できませんでした11-15 11:46: 41.118 19702-19956/com.example.apostolis.gpsapi15 W/DynamiteModule:失敗しました ロードモジュール経由で高速routetn:リモートロードに失敗しました。ローカルフォールバックなし が見つかりました。 11-15 11:46:41.119 19702-19956/com.example.apostolis.gpsapi15 W/DynamiteModule:ローカルモジュール記述子クラス com.google.android.gms.googlecertificatesが見つかりません。 11-15 11:46:41.124 19702-19956/com.example.apostolis.gpsapi15 I/DynamiteModule:ローカルモジュールを考慮する com.google.android.gms.googlecertificates:0とリモートモジュール com.google.android。 gms.googlecertificates:2 11-15 15:46:41.125 19702-19956/com.example.apostolis.gpsapi15 I/DynamiteModule:選択 com.google.android.gms.googlecertificatesのリモートバージョン = 2 11- 15 11:46:49.625 19702-19702/com.example.apostolis.gpsapi15I/System.out:34.69429310156397 --- 33.01508009433746 11-15 11:46:50.316 19702-19702/com.example.apostolis.gpsapi15 D/Var:OUT :: [email protected] 11-15 11:46:50.316 19702-19702/com.example.apostolis.gpsapi15 D/ImageFile: /storage/emulated/0/Tue Nov 15 11:46:50 GMT + 02:00 2016.jpg 11-15 11:46:50.317 19702-19702/com.example.apostolis.gpsapi15 D/mPath: /ストレージ/エミュレート/ 0/Tue Nov 15 11:46:50 GMT + 02:00 2016.jpg 11-15 11:46:50.771 19702-19702/com.example.apostolis.gpsapi15 I/System.out: バイト配列:[B @ 4772d89 11-15 11:46:50.772 19702-19702/com.example.apostolis.gpsapi15 D /配列:[B @ 4772d89 11-15 11:46:50.776 19702-19702/com.example .apostolis。gpsapi15 D/array_Str: iVBORw0KGgoAAAANSUhEUgAABDgAAAc4CAYAAADd + HYSAAAABHNCSVQICAgIfAhkiAAAIABJREFU eJzs3

+0

そこで質問や問題は何ですか? –

+0

bytearrayを取得できません。私は間違っているとわかりません。 もし間違っているとしたら、私に説明してください。 – Satanshaves

+0

'私が間違っていることを理解できません。あなたはあなたのコードが何をしなければならないか説明しなかった。まず、あなたがしたいことを正確に説明する必要があります。コードを投稿します。何が起こるべきかを発見するために私たちがあなたのコードを掘り下げるとは思わないでください。 – greenapps

答えて

0

あなたは、以下の機能を使用してFileオブジェクトからbyte[]を作成することができます。

byte[] fullyReadFileToBytes(File f) throws IOException { 
     int size = (int) f.length(); 
     byte bytes[] = new byte[size]; 
     byte tmpBuff[] = new byte[size]; 
     FileInputStream fis= new FileInputStream(f);; 
     try { 
      int read = fis.read(bytes, 0, size); 
      if (read < size) { 
       int remain = size - read; 
       while (remain > 0) { 
        read = fis.read(tmpBuff, 0, remain); 
        System.arraycopy(tmpBuff, 0, bytes, size - remain, read); 
        remain -= read; 
       } 
      } 
     } catch (IOException e){ 
      throw e; 
     } finally { 
      fis.close(); 
     } 

     return bytes; 
    } 

bitmap.compressを呼び出した後、ストリームを閉じるなど、上記の方法にあなたのimageFileオブジェクトを渡す:

byte[] byteArray = fullyReadFileToBytes(imageFile); 
Log.d("Activity", "Byte array: "+ Arrays.toString(byteArray));`