小编lok*_*oki的帖子

有没有办法判断使用什么技术来构建 Android 应用程序?

我下载并安装了一个 Android 应用程序,我还提取了 APK,

有什么方法可以从 apk 文件中知道用什么编程语言来编写程序?

是否有任何工具可以帮助解决这个问题?

哪些语言可以确定,哪些不能?

android apk

9
推荐指数
2
解决办法
5541
查看次数

ARC:TNetEncoding.GetBase64Encoding中是否存在内存泄漏?

下面是原始的Delphi源代码TNetEncoding.GetBase64Encoding.但我怀疑是否会出现内存泄漏AtomicCmpExchange(Pointer(FBase64Encoding), Pointer(LEncoding), nil) <> nil

 TNetEncoding = class
  private
    class var
      FBase64Encoding: TNetEncoding;
Run Code Online (Sandbox Code Playgroud)

class function TNetEncoding.GetBase64Encoding: TNetEncoding;
var
  LEncoding: TBase64Encoding;
begin
  if FBase64Encoding = nil then
  begin
    LEncoding := TBase64Encoding.Create;
    if AtomicCmpExchange(Pointer(FBase64Encoding), Pointer(LEncoding), nil) <> nil then
      LEncoding.Free;
{$IFDEF AUTOREFCOUNT}
    FBase64Encoding.__ObjAddRef;
{$ENDIF AUTOREFCOUNT}
  end;
  Result := FBase64Encoding;
end;
Run Code Online (Sandbox Code Playgroud)

我认为必须写成:

class function TNetEncoding.GetBase64Encoding: TNetEncoding;
var
  LEncoding: TBase64Encoding;
begin
  if FBase64Encoding = nil then
  begin
    LEncoding := TBase64Encoding.Create;
    if AtomicCmpExchange(Pointer(FBase64Encoding), Pointer(LEncoding), nil) <> nil then
      LEncoding.Free
{$IFDEF AUTOREFCOUNT} …
Run Code Online (Sandbox Code Playgroud)

delphi base64 encoding

9
推荐指数
1
解决办法
183
查看次数

为什么 gradlew :app:dependencyInsight 失败?

我尝试运行此命令以列出 firebase-messaging 库的所有依赖项:

gradlew :app:dependencyInsight --configuration compile --dependency firebase-messaging
Run Code Online (Sandbox Code Playgroud)

但它返回给我:

:app:dependencyInsight 在配置“:app:compile”中找不到与给定输入匹配的依赖项

BUILD SUCCESSFUL in 0s 1 个可操作的任务:1 个执行

这是我的 build.gradle 文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.test.myapplication"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:27.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.google.firebase:firebase-messaging:12.0.1'
}
Run Code Online (Sandbox Code Playgroud)

我做错了什么?

android gradle gradlew build.gradle android-gradle-plugin

9
推荐指数
2
解决办法
4685
查看次数

从零开始的字符串

system.sysutils.pas里约热内卢,他们添加了以下说明:

var intPart: String;

... IntPart.Chars[length(IntPart)] in ['1','3','5','7','9'] ...
Run Code Online (Sandbox Code Playgroud)

但是据我所知,s.Chars [xx]始终是从零开始的字符串,所以这样做IntPart.Chars[length(IntPart)] in ['1','3','5','7','9']总是会超出界限吗?

绝对不能写

... IntPart.Chars[length(IntPart)-1] in ['1','3','5','7','9'] ...
Run Code Online (Sandbox Code Playgroud)

还是我想念什么?

delphi delphi-10.3-rio

9
推荐指数
1
解决办法
201
查看次数

如何从视图中获取窗口实例?

我通过mWindowManager.addview(). 现在我想知道是否有可能获得window实例。他们是myView.getWindowID()myView.getWindowToken()但我找不到从中检索窗口实例的方法

android android-view android-windowmanager android-window

8
推荐指数
2
解决办法
5556
查看次数

比较 2 个接口 (IControl) 的好方法是什么?这是 Delphi 中的错误吗?

在Delphi的源代码中,我在FMX.Forms单元中看到了这样的内容:

procedure TCommonCustomForm.SetHovered(const Value: IControl);
begin
  if (Value <> FHovered) then
  begin
    ....
  end;
end;
Run Code Online (Sandbox Code Playgroud)

我认为这样做Value <> FHovered 从根本上来说是错误的,因为Value <> FHovered可以返回 true 并且同时两者都Value可以FHovered指向同一个TControl对象。我错了吗?(注意这是我在调试中看到的)。

现在有一个附属问题:为什么两个IControl接口可以不同(从指针的角度来看)但指向相同TControl

注意:下面的示例显示 2 如何IControl不同(从指针视图)但仍然指向同一个对象:

procedure TForm.Button1Click(Sender: TObject);
var LFrame: Tframe;
    Lcontrol: Tcontrol;
    LIcontrol1: Icontrol;
    LIcontrol2: Icontrol;
begin
  Lframe := Tframe.Create(nil);
  Lcontrol := Lframe;
  LIcontrol1 := Lframe;
  LIcontrol2 := Lcontrol;
  if LIcontrol1 <> LIcontrol2 then
    raise Exception.Create('Boom');
end;
Run Code Online (Sandbox Code Playgroud)

现在修复这个错误的好方法是什么?

delphi firemonkey

8
推荐指数
1
解决办法
331
查看次数

如何在我的android项目中添加com.google.gms:google-services:4.3.14?

当我阅读此文档时: https: //developers.google.com/android/guides/google-services-plugin他们说:

作为在 Android 应用程序中启用 Google API 或 Firebase 服务的一部分,您可能需要将 google-services 插件添加到您的 build.gradle 文件中:

dependencies {
    classpath 'com.google.gms:google-services:4.3.14'
    // ...
}
Run Code Online (Sandbox Code Playgroud)

然后他们还说:

添加已启用的服务所需的基本库的依赖项。此步骤要求您在 app/build.gradle 文件中应用 Google Services Gradle 插件,如下所示:apply plugin: 'com.google.gms.google-services'

所以我在android studio的最后一个版本中启动了一个空白的新android项目,并且我有根build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
}
Run Code Online (Sandbox Code Playgroud)

在 app/build.gradle 中:

plugins {
    id 'com.android.application'
}

android {
    namespace 'app.dependencieswalker'
    compileSdk 32

    defaultConfig { …
Run Code Online (Sandbox Code Playgroud)

android firebase google-play-services android-studio android-gradle-plugin

8
推荐指数
1
解决办法
2万
查看次数

IOS:如何计算要创建上下文的文本大小?

我需要创建一个包含一行文本的图像.但问题是,我首先需要创建上下文(CGBitmapContextCreate),要求图像的宽度和高度有可能以后计算文本的边界(通过CTLineGetImageBounds).但我想要图像的大小=文本的边界:(我该怎么办?

实际上我用

CGBitmapContextCreate
CTLineGetImageBounds
CTLineDraw
Run Code Online (Sandbox Code Playgroud)

也许可以在没有上下文的情况下调用CTLineGetImageBounds?

注意:我在delphi上,这不是一个真正的问题,因为我可以访问所有的API,我只需要函数名称

objective-c cgcontext ios swift

7
推荐指数
2
解决办法
2319
查看次数

他们的任何规则是根据屏幕的大小设置为图标/字体/等的大小

当我在智能手机上做应用程序时,我定义(例如)一个20px*20px的图标.这个图标在我的手机屏幕上看起来很棒,但不适用于大屏幕的平板电脑(如ipad pro).在这种情况下,图标看起来很小.

如果我按比例增加屏幕图标的大小,那么图标最终看起来太大了.举个例子:

  1. 在我的手机屏幕360*640上,图标大小为20x20px
  2. 在我的平板电脑屏幕1024x1366上,图标大小约为60px*60px =>太大了

有人知道设置图标/字体/等大小的好规则.根据屏幕的大小?我在delphi下(firemonkey)

delphi android ios firemonkey

7
推荐指数
1
解决办法
859
查看次数

如何使"myProc =对象的过程"弃用?

我在Delphi Tokyo第 2版下,我有这个声明:

type 
  FIRMessagingConnectCompletion = procedure of object;
Run Code Online (Sandbox Code Playgroud)

我会将其标记为已弃用.我试着这样:

type
  FIRMessagingConnectCompletion = procedure of object deprecated 'Please listen for the FIRMessagingConnectionStateChangedNotification NSNotification instead.';
Run Code Online (Sandbox Code Playgroud)

但没有错误的工作"E1030 Invalid compiler directive: 'DEPRECATED'".我错过了什么?

delphi

7
推荐指数
1
解决办法
269
查看次数