包含标签 Android 的文章

不折腾不休的小车中控支持Carplay过程

有一次在广州租车,发现插入手机之后Carplay就有了,手机的导航可以直接同步到中控屏幕上,玩起来很炫酷的。

于是想起之前给我家的老爷车换了Android的中控,就想着能不能把苹果的Carplay也在Android平台上运行起来

……

阅读全文

不折腾不休的macOS使用Android路由至内网环境

背景

为了测试动态路由协议的功能,我搭建了一套内部环境,这个环境不能访问到正常的办公网。 而如果我的macOS接入了这个内部网络,就能正常办公了,一些资料无法搜集,连接的跳板机也会断开。 ☞ 频繁切换两个网络环境让人痛苦不已。

……

阅读全文

React Native之Android原生模块反向通知JS

前边介绍了从JS调用Android原生模块的方法,现在再介绍一下,如何从Native反向通知JS。

一、目录结构

reactevent
├── ReactEvent.kt
├── ReactEventPkg.kt // ← here
└── ReactEventR.kt   // ← here

PS: ReactEventR中的R表示是反向的意思。

……

阅读全文

gomobile: Hook logrus日志输出至android logcat

实际开发过程中,很多项目使用的日志输出是logrus,为了保持统一,同时又能把日志输出到Android Logcat,同时还带上Android的日志级别。

默认的log.Println,也能输出,但默认的Tag是GoLog,日志级别是info,显然不能满足要求。

……

阅读全文

关于使用Go开发Android和iOS底层代码,你想了解的都在这。

先来讲一下使用Go语言开发Android和iOS底层代码的好处:

  • 可以编译成静态的libgojni.so<PKG>.framework
  • 跨平台代码复用率极高
  • 二进制程序的安全性很好
  • 代码可维护性很好

本文章介绍的内容:

  1. 如何传递Go语言的’对象’至目标平台的语言
  2. 如何传递目标平台语言至Go语言
  3. 可穿越语言边界的数据类型,以及如何传递复杂类型
  4. 如何在Go语言中使用目标平台语言已有的package
  5. 如何有针对性的区分androidiosGO语言代码
……

阅读全文

解决Android Studio Gobind错误Failed to transform file 'hello.aar' to...

错误表象

1
2
3
4
5
6
7
8
9
Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

最新的解决方法:

……

阅读全文