티스토리 뷰
http://c2design5sh.blogspot.com/2017/03/calling-apps-from-web-with-android.html
Calling apps from the web with Android Intent
How to call the Delphi Firemonkey App from a web page via Android Intent. At this point, the URL parameter values are sent to the App. ...
c2design5sh.blogspot.com
안드로이드 인 텐트를 통해 WEB page에서 Delphi Firemonkey APP을 호출하는 방법.
이 시점에서 URL 매개 변수 값이 Delphi Firemonkey APP으로 전송됩니다.
1. html 페이지를 만들어 웹에 설치하십시오. (callapp.html)
<a href=" delphiapp://callType1?title=This is a Type1&data1=1111&data2=2222">call Type1</a><BR><BR>
<a href=" delphiapp://callType2?title=This is a Type2&data1=3333&data2=4444&data3=5555">call Type2</a><BR><BR>
<a href=" delphiapp://callType2?title=Type2 : 한글로로 된 제목&data1=6666&data2=7777&data3=2번째 데이터"> call Type2 한글</a><BR><BR>
2. AndroidManifest.template.xml 파일에서 HTML 페이지의 uri 항목에 동일한 의도 필터 항목 추가
<?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%">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
<%uses-permission%>
<application android:persistent="%persistent%"
android:usesCleartextTraffic="true"
android:restoreAnyVersion="%restoreAnyVersion%"
android:label="%label%"
android:installLocation="%installLocation%"
android:debuggable="%debuggable%"
android:largeHeap="%largeHeap%"
android:icon="%icon%"
android:theme="%theme%"
android:hardwareAccelerated="%hardwareAccelerated%">
<!-- 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:label="%activityLabel%"
android:configChanges="orientation|keyboardHidden"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="%libNameValue%" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="callType1"
android:scheme="delphiapp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="callType2"
android:scheme="delphiapp" />
</intent-filter>
</activity>
<%activity%>
<receiver android:name="com.embarcadero.firemonkey.notifications.FMXNotificationAlarm" />
<%receivers%>
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->
3. 델파이 프로젝트 생성
procedure TForm1.FormCreate(Sender: TObject);
{$IFDEF ANDROID}
var
intent: JIntent;
uri: Jnet_Uri;
uriStr: String;
rValue : TStringList;
i : integer;
{$ENDIF}
begin
{$IFDEF ANDROID}
intent := SharedActivity.getIntent;
if intent <> nil then
begin
if TJIntent.JavaClass.ACTION_VIEW.equals(intent.getAction) then
begin
uri := intent.getData;
uriStr := JStringToString(uri.toString); // read uriStr
rValue := Get_URL_String( uriStr ); // parsing value
for i := 0 to rValue.Count-1 do
Memo1.Lines.Add( rValue[i] );
end;
end;
{$ENDIF}
end;
https://www.youtube.com/watch?v=O1v0Gw-hvOA
'FMX' 카테고리의 다른 글
(2020-05-07) FMX로 OAuth 2.0 with 카카오 API (0) | 2020.05.07 |
---|---|
(i) Embarcadero 10.3.2 Launch Webinar (0) | 2019.09.10 |
(URL) Android 용 기본 브리지 파일 생성기 인 Java2OP.exe (0) | 2019.08.29 |
(URL) FlexCel Android Guide (0) | 2019.08.28 |
(i) Delphi 10.3 FMX Android 권한 적용 방법 (0) | 2019.07.31 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- READ_PRIVILEGED_PHONE_STATE
- RADStudio11
- SOLO1ASP
- 식권발매
- Android 64
- push server
- 비에이블
- DelphiZeroMQ
- Could not convert variant of type (Null) into type (OleStr)
- 앱관리자
- FMX
- 스터디카페
- mysql db 복구
- 비에이블스터디카페
- 안드로이드_관리자
- 솔로몬시스템
- Delphi
- TT쿼리
- 키오스크
- 안드로이드관리자
- Unable to load project
- WidevineID
- KSNetPOSLib.ocx
- Firemonkey
- Grijjy
- 솔로원DB복제
- delphi push message
- KSNetPOSLib
- solomonsystem
- .dproj
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함