How to generate apk file programmatically through java code

后端 未结 4 1269
孤城傲影
孤城傲影 2020-12-14 05:06

I need to generate or build an APK file through some Java program where I select the Android source project. Suppose I have a button on a web page. When clicked, it generate

4条回答
  •  太阳男子
    2020-12-14 05:49

    An apk file is basically zip file. It's contains your resources and class dex files. Zygote create dalvik process, dalvikvm execute your java codes. You cannot create apk file programaticcally because it's look like classdex+resourcesmap. If you create programmatically apk write some ascii chars in text file wher is your drawable? Where is your app icon? But you will execute java class use dalvikvm. (Basiccally run class command -c ...)

提交回复
热议问题