1 2 3 4 |
{$IFDEF ANDROID},Androidapi.JNI.GraphicsContentViewText, FMX.Helpers.Android, IdURI, Androidapi.JNI.JavaTypes, Androidapi.Jni.Net, Androidapi.JNIBridge {$ENDIF}; |
The Java TimeInMills is similar to UnixTime but is in Millisenconds, so to convert it :
1 |
JavaTimeinMills := DateUtils.DateTimeToUnix(now) * 1000; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
procedure TfrmTimeDetail.btnShareClick(Sender: TObject); {$IFDEF ANDROID} var Intent: JIntent; CalendarIni: JCalendar; Uri : string; begin Uri := 'content://com.android.calendar/events'; Intent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_EDIT, TJnet_Uri.JavaClass.parse(StringToJString(TIdURI.URLEncode(uri)))); //Intent.setType(StringToJString('vnd.android.cursor.item/event')); intent.putExtra(StringToJString('beginTime'), DateTimeToUnix( (clDay.Date + teTimeDal.Time)) * 1000 ); intent.putExtra(StringToJString('allDay'), false); intent.putExtra(StringToJString('rrule'), StringToJString('FREQ=YEARLY')); intent.putExtra(StringToJString('endTime'), DateTimeToUnix( (clDay.Date + teTimeAl.Time)) * 1000 ); intent.putExtra(StringToJString('title'), StringToJString(edCommessa.Text)); intent.putExtra(StringToJString('description'), StringToJString(Memo1.Text)); SharedActivity.startActivity(Intent); end; |
Con VMWare Player per disabilitare la sospensione automatica di una macchina virtuale, bisogna editare il file .vmx ed aggiungere la seguante riga:
1 |
suspend.disabled = "TRUE" |
dalla documentazione originale: To disable the suspend feature for a virtual machine in VMware Fusion: Shutdown the virtual machine. Locate the virtual machine bundle. For more information, see Locating the virtual machine…
Leggi tutto
Problem : Compiling an Android Project with Delphi XE5 i had a Linker Error E2597 on libibtogo.o Today i lose 4 hours on compiling my Android Delphi project, because i removed a used unit : Data.DBXInterbase . I reintroduced that library and all function well like before 🙂 Error detail: [DCC Error] E2597 F:PlatformSDKsandroid-ndk-r8etoolchainsarm-linux-androideabi-4.6prebuiltwindowsbinarm-linux-androideabi-ld.exe: f:\embarcadero\12.0\lib\Android\Release/libibtogo.a(util.o):…
Leggi tutto
http://eoracle11g.blogspot.it/p/alter-user-information.html
The IMEI code is an unique number like the MAC Adrress for the lan on mobile devices… so in this example i have only putted a TButton on the form and wrote this piece of code that i found on the net:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
uses System.IOUtils,IdGlobalProtocols {$IFDEF ANDROID} ,FMX.Helpers.Android, Androidapi.JNI.GraphicsContentViewText, Androidapi.JNI.Net, Androidapi.JNI.JavaTypes, idUri,Androidapi.IOUtils {$ENDIF ANDROID} {$IFDEF MSWINDOWS }, WinAPI.ShellApi, WinAPI.Windows {$ENDIF} {$IFDEF ANDROID} ,Androidapi.JNI.Telephony, Androidapi.JNI.Provider, Androidapi.JNIBridge, Androidapi.Jni, Androidapi.JNI.Dalvik {$ENDIF ANDROID}; procedure TfrmMain.Button1Click(Sender: TObject); var {$IFDEF ANDROID} obj: JObject; tm: JTelephonyManager; {$ENDIF} identifier: String; begin {$IFDEF ANDROID} obj := SharedActivityContext.getSystemService(TJContext.JavaClass.TELEPHONY_SERVICE); if obj <> nil then begin tm := TJTelephonyManager.Wrap( (obj as ILocalObject).GetObjectID ); if tm <> nil then identifier := JStringToString(tm.getDeviceId); end; if identifier = '' then identifier := JStringToString(TJSettings_Secure.JavaClass.getString(SharedActivity.getContentResolver,TJSettings_Secure.JavaClass.ANDROID_ID)); {$ENDIF ANDROID} ShowMessage(identifier); end; |