How return the window Find Static Library?

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

How return the window Find Static Library?

Postby Lena » Fri May 05, 2017 12:08 am

Hi.
I use this article:
How to use Android Service(TAndroidService) in C++Builder
I try to add services in my project with TBeacon.
When compile I got errors:
Unabled to find static library: libdelphiandroidservises.a, libvclie.a....
I saw window "Find Static Library". I set "Remove the reference" and set "Don't ask me again". The compilation was successful.
Today I open project and got errors again but I don't see window "Find Static Library".
How to get window "Find Static Library" back now and fix this errors?
Code: Select all
[ldandroid Error] C:\Users\Public\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -ldelphiandroidservices
[ldandroid Error] C:\Users\Public\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -lvclactnband
[ldandroid Error] C:\Users\Public\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -lvclx
[ldandroid Error] C:\Users\Public\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -lvcl
[ldandroid Error] C:\Users\Public\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -lvclimg
[ldandroid Error] C:\Users\Public\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -lvclie
Lena
BCBJ Master
BCBJ Master
 
Posts: 473
Joined: Sun Feb 06, 2011 1:28 pm

Re: How return the window Find Static Library?

Postby rlebeau » Fri May 05, 2017 1:32 pm

VclActnBand, Vclx, Vcl, VclImg, VclIE - those are all VCL libraries for Windows only, they are not FMX libraries, and as such are not available for Android. It sounds like you started with a VCL project instead of a FMX project. Start over and try again.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1410
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: How return the window Find Static Library?

Postby Lena » Fri May 05, 2017 10:17 pm

1. I have С++ Builder berlin Android project with component of TBeacon and the project works successfully on my phone.
2. Now I am using the standard Delphi example for Android service. In the service I add the component TBeacon. This component cannot be used in Windows. Compilation is successful.
3. Add this service in my Android project. Then compile project and got errors.
Android service code:
Code: Select all
//---------------------------------------------------------------------------
// Copyright (c) 2016 Embarcadero Technologies, Inc. All rights reserved. 
//
// This software is the copyrighted property of Embarcadero Technologies, Inc.
// ("Embarcadero") and its licensors. You may only use this software if you
// are an authorized licensee of Delphi, C++Builder or RAD Studio
// (the "Embarcadero Products").  This software is subject to Embarcadero's
// standard software license and support agreement that accompanied your
// purchase of the Embarcadero Products and is considered a Redistributable,
// as such term is defined thereunder. Your use of this software constitutes
// your acknowledgement of your agreement to the foregoing software license
// and support agreement.
//---------------------------------------------------------------------------
unit BeaconServiceUnit;

interface

uses
  System.SysUtils,
  System.Classes,
  System.Android.Service,
  AndroidApi.JNI.GraphicsContentViewText,
  Androidapi.JNI.Os, System.Beacon, System.Notification, System.Beacon.Components,
  System.Bluetooth;

type
  TBeaconServiceDM = class(TAndroidService)
    Beacon1: TBeacon;
    NotificationCenter1: TNotificationCenter;
    procedure Beacon1BeaconProximity(const Sender: TObject; const ABeacon: IBeacon; Proximity: TBeaconProximity);
    function AndroidServiceStartCommand(const Sender: TObject; const Intent: JIntent; Flags, StartId: Integer): Integer;
    procedure Beacon1BeaconEnter(const Sender: TObject; const ABeacon: IBeacon;
      const CurrentBeaconList: TBeaconList);
  private
    { Private declarations }
    procedure NotifyBeaconProximity(const BeaconName: string);
  public
    { Public declarations }
  end;

var
  BeaconServiceDM: TBeaconServiceDM;

implementation

{%CLASSGROUP 'FMX.Controls.TControl'}

{$R *.dfm}

uses
  Androidapi.JNI.App;

function TBeaconServiceDM.AndroidServiceStartCommand(const Sender: TObject; const Intent: JIntent; Flags,
  StartId: Integer): Integer;
begin
  Beacon1.Enabled := True;
  Result := TJService.JavaClass.START_STICKY;
end;

procedure TBeaconServiceDM.Beacon1BeaconEnter(const Sender: TObject;
  const ABeacon: IBeacon; const CurrentBeaconList: TBeaconList);
 var Major, Minor : Word;
begin
  //NotifyBeaconProximity('BE: ' + ABeacon.GUID.ToString + ':' + ABeacon.Major.ToString + ',' + ABeacon.Minor.ToString);

   Major := ABeacon.Major;
   Minor := ABeacon.Minor;
   IF(Major <> 10) OR (Minor <> 1)then
      begin
        exit;
      end;

  NotifyBeaconProximity('Hello!');

end;

procedure TBeaconServiceDM.Beacon1BeaconProximity(const Sender: TObject; const ABeacon: IBeacon;
  Proximity: TBeaconProximity);
begin
  //if Proximity = TBeaconProximity.Immediate then
    //NotifyBeaconProximity(ABeacon.GUID.ToString + ':' + ABeacon.Major.ToString + ',' + ABeacon.Minor.ToString);
end;

procedure TBeaconServiceDM.NotifyBeaconProximity(const BeaconName: string);
var
  MyNotification: TNotification;
begin
  MyNotification := NotificationCenter1.CreateNotification;
  try
    MyNotification.Name := 'BeaconProximityNotification';
    //MyNotification.AlertBody := 'Beacon Proximity detected: '+  BeaconName;
    MyNotification.AlertBody := BeaconName;
    NotificationCenter1.PresentNotification(MyNotification);
  finally
    MyNotification.Free;
  end;
end;

end.
Attachments
132.jpg
132.jpg (53.88 KiB) Viewed 2564 times
Lena
BCBJ Master
BCBJ Master
 
Posts: 473
Joined: Sun Feb 06, 2011 1:28 pm

Re: How return the window Find Static Library?

Postby rlebeau » Sat May 06, 2017 12:33 am

Lena wrote:3. Add this service in my Android project. Then compile project and got errors.


Sounds like another IDE bug.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1410
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: How return the window Find Static Library?

Postby Lena » Sat May 06, 2017 2:16 am

When I saw the window Find Static Library I was able to compile. Is there a way to return this window?
Lena
BCBJ Master
BCBJ Master
 
Posts: 473
Joined: Sun Feb 06, 2011 1:28 pm


Return to Technical

Who is online

Users browsing this forum: Bing [Bot] and 7 guests

cron