Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consult #1

Open
Robsalinas99 opened this issue Dec 2, 2019 · 3 comments
Open

consult #1

Robsalinas99 opened this issue Dec 2, 2019 · 3 comments

Comments

@Robsalinas99
Copy link

I'm programming with Delphi 10.3 CE, I downloaded y ran it, but does not recognize Androidapi.JNI.GraphicsContentViewText, Androidapi.JNI.JavaTypes,
Androidapi.JNI.Net, Androidapi.Helpers, FMX.Helpers.android. what do i have to do?

@DaveBolt
Copy link

I am guessing that Community Edition does not have the Androidapi.* source files.
Check for the following folder.
C:\Program Files (x86)\Embarcadero\Studio\21.0\source\rtl\android
For Delphi 10.3 it's 21.0, for Delphi 11 it's 22.0 in the above path.

@benselilih
Copy link

Screenshot_20220205-174850
Is there some update for this issue

@mesutgencer
Copy link

Screenshot_20220205-174850 Is there some update for this issue

I think following codes will do the job as it worked perfectly fine.
{ It is very important you have <%provider%> line in your AndroidManifest.template.xml file in your project folder
<application
android:persistent="%persistent%"
....
>
<%provider%>
<%application-meta-data%>
}

Intent := TJIntent.Create;
Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
if TJBuild_VERSION.JavaClass.SDK_INT >= TJBuild_VERSION_CODES.JavaClass.N then
begin

   lFile := TJFile.JavaClass.init(StringToJString(FileName));

   Intent.setFlags(

TJIntent.JavaClass.FLAG_GRANT_READ_URI_PERMISSION

  • TJIntent.JavaClass.FLAG_GRANT_WRITE_URI_PERMISSION);

     Intent.addFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK);
     Data := TJcontent_FileProvider.JavaClass.getUriForFile(
    

TAndroidHelper.Context,
StringToJString(
JStringToString(TAndroidHelper.Context.getApplicationContext.getPackageName) + '.fileprovider'), lFile);
end
else
begin
Data := TJnet_Uri.JavaClass.parse(StringToJString('file://' + FileName));
end;

Intent.setDataAndType(Data, StringToJString('application/pdf'));
TAndroidHelper.Activity.startActivity(Intent);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants