android studio platform使用体验分享(as无法跳转c/c++等native源码的福音,强烈推荐)

hi,粉丝朋友们:

大家好!这些天粉丝朋友们分享了一下Android Studio for Platform 这个最新的google开发的阅读aosp源码的工具,特别适合做原生系统开发。具体官方介绍如下地址:

参考链接:https://developer.android.google.cn/studio/platform

1、android studio for platform工具介绍

可以直接点击下载(提示目前只有ubuntu可以哈,其他没有,所以说跟着马哥使用ubuntu开发还是有很大优势,尝鲜方便)

看看相关的官方介绍:

Android Studio for Platform (ASfP) is the version of the Android Studio IDE for Android Open Source Project (AOSP) platform developers who build with the Soong build system. ASfP includes the following features:

language
Multi-language Support
Edit C++, Kotlin, and Java programming languages in the same IDE.
settings
Project Setup Wizard
Configure your lunch target and platform modules.

官方的介绍就以上一小段文字,总结如下:

ASfP是专门用于开发aosp的ide工具,有着 Soong build system.,主要有以下几个特点

语言支持部分:

同时支持:C++, Kotlin, and Java 同时使用在ide中编程

设置部分:

可以配置你的编译target和具体的模块

2、android studio for platform痛点解决

这里最吸引我们的还是他居然支持多语言,c++,java,kotlin同时都支持。

以前我们开发aosp时候,其实java部分使用android studio的体验还是相当好,但是android studio没办法支持c++等native代码的跳转和代码提示,所以不得不使用vscode工具,这个vscode工具相关看c++等代码也是比较方便,基本上的代码也是可以跳转的,但是毕竟有时候需要两个工具相互切快捷键等还是有一点点不方便,虽然不太影响。

所以开发aosp之前的选择就是:

java相关代码使用android studio

c++相关代码使用vscode

目前ASfP工具出现真的是我们framework开发者的一个巨大福音,解决了android studio无法跳转c++代码的这个巨大痛点。

3、android studio for platform使用体验

官方使用介绍:

bash 复制代码
Get started with ASfP

    If you haven't already installed repo, follow the instructions at Installing Repo.
    If you haven't already initialized and synced your Repo checkout, follow the instructions at Initializing a Repo client.
    Download ASfP.
    Install ASfP: sudo dpkg -i /path/to/asfp-2023.1.1.19-linux.deb.
    Open ASfP from the command line: /opt/android-studio-for-platform/bin/studio.sh.
    Import your project by pointing to your repo checkout directory, specifying a lunch target, and selecting which modules you want to build.
    Click Finish and your project will begin syncing.
    Request to join our external group for user support.

这里我们就直接自己转化把

1、下载好工具,安装好即可以(限制在ubuntu)

可以直接点击安装的

2、启动工具

在terminator下面输入如下命令:

/opt/android-studio-for-platform/bin/studio.sh

就会启动工具

3、导入需要模块

这里导入了Launcher和framework

同步完成就一切都好了即可以查看相关代码和跳转。

ps使用的注意点:

1、跳转framework的类时候会跳到对应jar包的class文件,不是java文件,解决如下

2、KeyMap如果习惯eclipse的可以切换

3、如果导入c++相关开发建议以下3个文件夹:

frameworks

system

packages

导入越多整体就慢

总结体验:

整体体验和以前android studio没有大的差别

1、不过说实话单独java部分的代码开发的话,体验还不如以前的android studio轻量,反而依赖的东西太多,对于跳转等,查找代码还没有以前方便,针对java部分的话,这个建议可以先观望等更多版本更新稳定

2、c++部分的native代码,来说简直就利器,非常好用,跳转准确,非常值的推荐

google官方教学视频教程地址:
https://www.bilibili.com/video/BV1UV411P7nf/?vd_source=a8c604ee3ce4999324264828f8fd99d8

相关推荐
qianbo_insist22 分钟前
simple c++ 无锁队列
开发语言·c++
zengy522 分钟前
Effective C++中文版学习记录(三)
数据结构·c++·学习·stl
model200524 分钟前
android + tflite 分类APP开发-2
android·分类·tflite
彭于晏68934 分钟前
Android广播
android·java·开发语言
MinBadGuy1 小时前
【GeekBand】C++设计模式笔记5_Observer_观察者模式
c++·设计模式
与衫2 小时前
掌握嵌套子查询:复杂 SQL 中 * 列的准确表列关系
android·javascript·sql
菜鸟一皓2 小时前
IDEA的lombok插件不生效了?!!
java·ide·intellij-idea
QuantumStack4 小时前
【C++ 真题】B2037 奇偶数判断
数据结构·c++·算法
结衣结衣.5 小时前
C++ 类和对象的初步介绍
java·开发语言·数据结构·c++·笔记·学习·算法
学习使我变快乐5 小时前
C++:静态成员
开发语言·c++