Перейти к содержанию
Fire Monkey от А до Я

mestok

Пользователи
  • Постов

    15
  • Зарегистрирован

  • Посещение

Весь контент mestok

  1. Здравствуйте! Не подскажите, есть ли какая-то возможность установить приложения не в диск C, а в указанный путь? Может кто "бился" с install`ером on-line`ером...
  2. Еще, может имеет значение - прога развивалась из примера ForegroundLocationDemo. Ну и с манифестом что-то делал помню, а что - не помню))) Манифест в итоге: <?xml version="1.0" encoding="utf-8"?> <!-- BEGIN_INCLUDE(manifest) --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.Cont" android:versionCode="1" android:versionName="2.4.8" android:installLocation="auto"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="32" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" /> <uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" /> <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" /> <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <uses-permission android:name="android.permission.BLUETOOTH_SCAN" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.READ_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_SETTINGS" /> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> <uses-feature android:glEsVersion="0x00020000" android:required="true"/> <queries> </queries> <application android:persistent="False" android:restoreAnyVersion="False" android:label="Cont" android:debuggable="true" android:largeHeap="False" android:icon="@drawable/ic_launcher" android:theme="@style/AppTheme" android:hardwareAccelerated="true" android:resizeableActivity="true" android:requestLegacyExternalStorage="true" android:forceDarkAllowed="true"> <provider android:name="androidx.core.content.FileProvider" android:authorities="com.Cont.fileprovider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" /> </provider> <service android:name="com.embarcadero.services.ContService" android:exported="false" /> <!-- Our activity is a subclass of the built-in NativeActivity framework class. This will take care of integrating with our NDK code. --> <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity" android:exported="true" android:label="Cont" android:configChanges="orientation|keyboard|keyboardHidden|screenSize" android:resizeableActivity="false" android:launchMode="singleTask"> <!-- Tell NativeActivity the name of our .so --> <meta-data android:name="android.app.lib_name" android:value="Cont" /> <meta-data android:name="android.max_aspect" android:value="2.4" /> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" /> </application> </manifest> <!-- END_INCLUDE(manifest) --> Манифест в проекте: <?xml version="1.0" encoding="utf-8"?> <!-- BEGIN_INCLUDE(manifest) --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="%package%" android:versionCode="%versionCode%" android:versionName="%versionName%" android:installLocation="%installLocation%"> <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" /> <%uses-permission%> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.READ_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_SETTINGS" /> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> <uses-feature android:glEsVersion="0x00020000" android:required="true"/> <queries> <%queries-child-elements%> </queries> <application android:persistent="%persistent%" android:restoreAnyVersion="%restoreAnyVersion%" android:label="%label%" android:debuggable="%debuggable%" android:largeHeap="%largeHeap%" android:icon="%icon%" android:theme="%theme%" android:hardwareAccelerated="%hardwareAccelerated%" android:resizeableActivity="true" android:requestLegacyExternalStorage="true" android:forceDarkAllowed="true"> <%provider%> <%application-meta-data%> <%uses-libraries%> <%services%> <!-- Our activity is a subclass of the built-in NativeActivity framework class. This will take care of integrating with our NDK code. --> <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity" android:exported="true" android:label="%activityLabel%" android:configChanges="orientation|keyboard|keyboardHidden|screenSize" android:resizeableActivity="false" android:launchMode="singleTask"> <!-- Tell NativeActivity the name of our .so --> <meta-data android:name="android.app.lib_name" android:value="%libNameValue%" /> <meta-data android:name="android.max_aspect" android:value="2.4" /> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <%activity%> <%receivers%> </application> </manifest> <!-- END_INCLUDE(manifest) -->
  3. Доброго ...! В своей программе, на сколько помню, с подобным боролся когда-то... Не знаю, от этого зависит или нет, но вот код у меня такой: В MainForm.Create код: var ApplicationEventService: IFMXApplicationEventService; if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationEventService, ApplicationEventService) then ApplicationEventService.SetApplicationEventHandler(HandleApplicationEvent); vFlags := TJWindowManager_LayoutParams.JavaClass.FLAG_TURN_SCREEN_ON or TJWindowManager_LayoutParams.JavaClass.FLAG_DISMISS_KEYGUARD or TJWindowManager_LayoutParams.JavaClass.FLAG_SHOW_WHEN_LOCKED or TJWindowManager_LayoutParams.JavaClass.FLAG_KEEP_SCREEN_ON; aEnable := true; if aEnable then begin CallInUIThread( procedure begin TAndroidHelper.Activity.getWindow.setFlags(vFlags, vFlags); end); end else CallInUIThread( procedure begin TAndroidHelper.Activity.getWindow.clearFlags(vFlags); end); Функция HandleApplicationEvent: function TMainForm.HandleApplicationEvent(ApplicationEvent: TApplicationEvent; Context: TObject): Boolean; begin case ApplicationEvent of TApplicationEvent.WillBecomeInactive: begin TAndroidHelper.Activity.getWindow().addFlags(TJWindowManager_LayoutParams.JavaClass.FLAG_DISMISS_KEYGUARD or TJWindowManager_LayoutParams.JavaClass.FLAG_SHOW_WHEN_LOCKED or TJWindowManager_LayoutParams.JavaClass.FLAG_FULLSCREEN or TJWindowManager_LayoutParams.JavaClass.FLAG_LAYOUT_IN_SCREEN ); end; else Result := False; end end; Флаги может не все нужны, а может и код вообще не о том - давно было)...
  4. Спасибо! Работает!
  5. JGnssStatus в модуле Androidapi.JNI.GnssStatusCallback.pas был не определен... - я добавил. Но правильно, или нет - вопрос. При попытке выполнить нижеуказанный код вылетает исключение "interface not supported". Что я делаю не так? Код формы: unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Controls.Presentation,Androidapi.JNI.GnssStatusCallback, System.Android.Sensors, System.Sensors,Androidapi.JNI.Location, FMX.Memo.Types, FMX.ScrollBox, FMX.Memo, Androidapi.JNI.GraphicsContentViewText, Androidapi.JNIBridge, Androidapi.JNI.App, Androidapi.Helpers, Androidapi.JNI.JavaTypes, System.Sensors.Components; type TForm7 = class(TForm) CornerButton1: TCornerButton; Memo1: TMemo; × unit Unit1; LocationSensor1: TLocationSensor; procedure CornerButton1Click(Sender: TObject); private public end; var Form7: TForm7; implementation {$R *.fmx} type TMyGnssStatusCallbackDelegate = class(TJGnssStatusCallbackDelegate) public procedure onFirstFix(ttffMillis: Integer); cdecl; procedure onSatelliteStatusChanged(status: JGnssStatus); cdecl; procedure onStarted; cdecl; procedure onStopped; cdecl; end; procedure TMyGnssStatusCallbackDelegate.onFirstFix(ttffMillis: Integer); begin //... end; procedure TMyGnssStatusCallbackDelegate.onSatelliteStatusChanged(status: JGnssStatus); begin // Событие изменения статуса спутников end; procedure TMyGnssStatusCallbackDelegate.onStarted; begin // Событие запуска отслеживания GNSS end; procedure TMyGnssStatusCallbackDelegate.onStopped; begin // Событие остановки отслеживания GNSS end; procedure TForm7.CornerButton1Click(Sender: TObject); var LocationManager: JLocationManager; LocationProviders: JList; GnssStatusCallbackClass: JGnssStatusCallbackClass; GnssStatusCallback: JGnssStatusCallback; i: Integer; begin try LocationManager := TAndroidHelper.Context.getSystemService(TJContext.JavaClass.LOCATION_SERVICE) as JLocationManager; LocationProviders := LocationManager.getProviders(True); for i := 0 to LocationProviders.size - 1 do begin if (LocationProviders.get(i) as JString).equals(TJLocationManager.JavaClass.GPS_PROVIDER) then begin GnssStatusCallbackClass := TJavaGenericImport<JGnssStatusCallbackClass, JGnssStatusCallback>.JavaClass; GnssStatusCallback := GnssStatusCallbackClass.init(TAndroidHelper.Context, TMyGnssStatusCallbackDelegate.Create); Exit; end; end; except on E: Exception do begin Memo1.Lines.Add('Error checking GNSS status: ' + E.Message); end; end; end; end. Androidapi.JNI.GnssStatusCallback.zip
  6. Супер!!! Спасибо! А можно пример в проекте? - не пойму как "прикрутить" вызов...
  7. Ай, яй-яй... Чтож я в модуль не полез. Спасибо!
  8. Добрый день! Не подскажите, кто если сталкивался?... Пытаюсь получить число спутников на Android`е. Прога "падает". Под Win (если uses System.Android.Sensors заменить на System.Win.Sensors) работает. Может есть у кого решение? Код модудя: uses System.Android.Sensors, System.Sensors; type TMyPlatformGpsStatus = class(TPlatformGpsStatus) public class function GetGpsStatusImplementer: TGpsStatusClass; override; end; { TMyPlatformGpsStatus } class function TMyPlatformGpsStatus.GetGpsStatusImplementer: TGpsStatusClass; begin Result := inherited; end; По клику баттона: Label2.Text:=IntToStr(TMyPlatformGpsStatus.GetGpsStatusImplementer.SatelliteCount);
  9. Спасибо большое за исчерпывающий ответ!
  10. В фалах проекта, в папке res нет файла с именем color. Или я его не там ищу? Добавил свой файл color.xml через Deployment в папку res\values. В файле код: <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <color name="black">#6156ed</color> </resources> Результата нет.
  11. mestok

    splash_image_def rad 11.3

    Здравствуйте товарищи! Есть вопрос - может кто сталкивался... Как в "splash_image_def", в теге <item android:drawable="@android:color/black" />" установить "свой" цвет, по типу rgb(100,100,120), или "#0066cc" знает кто? Пробовал "<item android:drawable="@android:color/#910012"/>" - не компилирует...
×
×
  • Создать...