Junjun&3588 个人博客

-个人博客-
热爱技术,喜欢科技. Hello Coder!!
  1. 首页
  2. 编程语言
  3. 移动APP
  4. 正文

Titanium 開發 Android App 時使用中文名稱

2011-06-14 555点热度 0人点赞 0条评论
    1. Step 1
      1. 打開專案 (例如. TestTabIcon/build/android/AndroidManifest.xml)

      2. 找到以下句子並更改檔案 App 名稱
      android:label="TestTabIcon" to android:label="什麼都好"

      3. 按下 cmd + i 在 AndroidManifest.xml 之上

      4. 改變權限 "sharing & permissions"
      所有用戶群集都是 "只讀"

      Step 2
      1. 打開目錄 (注: 這裡為 1.7.0 RC1)
      /Library/Application Support/Titanium/mobilesdk/osx/1.7.0.RC1/android

      2. 打開 builder.py
      找到

      if new_manifest_contents != old_contents:
      trace("Writing out AndroidManifest.xml")
      amf = open(android_manifest,'w')
      amf.write(new_manifest_contents)
      amf.close()
      manifest_changed = True

      改為

      if new_manifest_contents != old_contents:
      pass
      #trace("Writing out AndroidManifest.xml")
      #amf = open(android_manifest,'w')
      #amf.write(new_manifest_contents)
      #amf.close()
      #manifest_changed = True

      3. 打開 android.py
      找到

      def render(self, template_dir, template_file, dest, dest_file, **kwargs):
      tmpl = self.load_template(os.path.join(template_dir, 'templates', template_file))
      f = None
      try:
      print "[TRACE] Generating %s" % os.path.join(dest, dest_file)
      f = open(os.path.join(dest, dest_file), "w")
      f.write(tmpl.render(config = self.config, **kwargs))
      finally:
      if f!=None: f.close

      改為

      def render(self, template_dir, template_file, dest, dest_file, **kwargs):
      tmpl = self.load_template(os.path.join(template_dir, 'templates', template_file))
      f = None
      if dest_file != "AndroidManifest.xml":
      try:
      print "[TRACE] Generating %s" % os.path.join(dest, dest_file)
      f = open(os.path.join(dest, dest_file), "w")
      f.write(tmpl.render(config = self.config, **kwargs))
      finally:
      if f!=None: f.close
      else:
      print "[TRACE] Skip AndroidManifest.xml ..................................";

      Step 3
      1. 重新安裝到模擬器上

      *** 註意地方
      1. 找不到 AndroidManifest.xml
      請還原以上步驟,先 Build 出第一次

      2. 找不到 Step 2 目錄
      請將 1.7.0 RC 換成你的 SDK 版本再試

      3. 在模擬器看不到已經變更
      請再嘗試安裝到真機上

      4. 在真機上看不到已變更
      請移除原有的 App 再安裝試試

 

标签: 暂无
最后更新:2011-06-14

admin3588

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

COPYRIGHT © 2022 Junjun&3588 个人博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang