পোস্টগুলি

ফেব্রুয়ারি, ২০১৭ থেকে পোস্টগুলি দেখানো হচ্ছে

Appcelerator Android Module : Access assets in my actual application

import org.appcelerator.titanium.io.TitaniumBlob; File imageFile = new TitaniumBlob( "android/default.png" ).getFile(); If you need it as a Blob you can do this import org.appcelerator.titanium.io.TitaniumBlob; import org.appcelerator.titanium.TiBlob; TiBlob blob = TiBlob.blobFromFile( new TitaniumBlob( "android/default.png" ));

Appcelerator : Add permission WRITE_EXTERNAL_STORAGE for android 6

< uses-permission android : name = " android.permission.WRITE_EXTERNAL_STORAGE " /> var permission = ' android.permission.WRITE_EXTERNAL_STORAGE ' ; function saveToGallery () { var videoFile = Ti . Filesystem . getFile ( ' BigBuckBunny_320x180.mp4 ' ); Ti . Media . saveToPhotoGallery ( videoFile . read (), { success : function ( e ) { console . log ( ' SAVED TO GALLERY! ' ); }, error : function ( e ) { console . log ( ' SAVE ERROR: ' , e) } }); } if ( Ti . Android . hasPermission (permission)) { saveToGallery (); } else { Ti . Android . requestPermissions ([permission], function ( e ) { if ( e . success ) { saveToGallery (); } else { Ti . API . info ( ' PERMISSIONS ERROR: ' + e . error ); } }); }

Android : Check Network Connection

private void checkNetworkConnection() { ConnectivityManager connMgr = (ConnectivityManager)getActivity().getSystemService(Context. CONNECTIVITY_SERVICE ); NetworkInfo activeInfo = connMgr.getActiveNetworkInfo(); if ( activeInfo != null && activeInfo .isConnected()) { wifiConnected = activeInfo .getType() == ConnectivityManager. TYPE_WIFI ; mobileConnected = activeInfo .getType() == ConnectivityManager. TYPE_MOBILE ; if ( wifiConnected ) { //Log.i(TAG, getString(R.string.wifi_connection)); Toast. makeText (getActivity().getApplicationContext(), "wifi_connection" ,Toast. LENGTH_LONG ).show();; } else if ( mobileConnected ){ // Log.i(TAG, getString(R.string.mobile_connection)); Toast. makeText (getActivity().getApplicationContext(), "mobile_connection" ,Toast. LENGTH_LONG ).show(); } } else { //Log.i(TAG, getString(R...