有没有办法使我的Android设备飞行显示XML布局?

发布于 2025-01-18 07:50:18 字数 973 浏览 2 评论 0原文

我开始学习Android(通过繁忙的编码器的指南),我更喜欢在IDE上使用命令行工具,到目前为止,它进展顺利(现在在第12章中),

但是我想知道我是否可以自动化建筑物的过程以显示显示布局内容live(例如带有HTML网页的实时服务器),

而不仅仅是进入终端输入构建命令并等待几个sec或某些内容以上传

我想要的应用程序:

  • 类似于主机上的脚本仅在更改上执行以下脚本

  • 和Android端,以保持应用程序打开并更新更改,而不是关闭应用程序,并需要我再次重新启动此10至10每次更改的15秒都会在我的学习过程中产生很大的影响

我使用Linux Debian和以下构建命令行脚本

target=$1

if  [ "$1" = "" ]; then
    target="a.apk"
fi



aapt package -f -v \
    -I ~/android-sdk/platforms/android-30/android.jar \
    -J src -m \
    -M AndroidManifest.xml \
    -S res \
    -F bin/resources.ap_

javac \
    -bootclasspath ~/android-sdk/platforms/android-30/android.jar \
    -classpath src -source 1.8 -target 1.8 \
    src/dom/domain/*.java

dx --dex --output=bin/classes.dex src

cd bin

mv resources.ap_    $target

aapt add    $target classes.dex

printf 'android\n' | apksigner sign -ks ~/code/android/debug.keystore $target

adb install -r $target
 

I am starting to learn android (through the busy coder's guide book) and I prefer using the commandline tools over the IDE and it's going well so far (in chapter 12 now)

But I am wondering If i can automate the building process to just display the layout content live (like live server with html web pages)

instead of just going to the terminal entering the build command and waiting for a few sec or something for the app to upload

I want:

  • something like a script on the host side to just execute the below script on changes

  • and on the android side to just keep the app open and update the changes instead of shutting the app off and needs me to restart it again this 10 to 15 secs on every change would make a much difference in my learning process

I use linux debian and the following command line script for building

target=$1

if  [ "$1" = "" ]; then
    target="a.apk"
fi



aapt package -f -v \
    -I ~/android-sdk/platforms/android-30/android.jar \
    -J src -m \
    -M AndroidManifest.xml \
    -S res \
    -F bin/resources.ap_

javac \
    -bootclasspath ~/android-sdk/platforms/android-30/android.jar \
    -classpath src -source 1.8 -target 1.8 \
    src/dom/domain/*.java

dx --dex --output=bin/classes.dex src

cd bin

mv resources.ap_    $target

aapt add    $target classes.dex

printf 'android\n' | apksigner sign -ks ~/code/android/debug.keystore $target

adb install -r $target
 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反话 2025-01-25 07:50:18

在Android Studio上,安装了应用程序后,您可以使用应用更改代码和资源更改运行应用程序而无需重新启动应用程序,在某些情况下,无需重新启动当前活动。

On Android Studio, once your app is installed you can use Apply Changes to push code and resource changes to your running app without restarting your app and, in some cases, without restarting the current activity.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文