トップページ > 記事閲覧
Android:文字入力
名前:ギウ 日時: 2017/06/14 10:35

お世話になっております。 Android版で、JAVAを使った文字入力(〜/Android_Java.html)を試してみたのですが、実行して直ぐに 「問題が発生したため、「(アプリ名)」を終了します」 と出てしまいます。 VisualStudioは、2015です。 JAVAを使おうとしたときに、何かをインストールしてほしそうなメッセージが出たので、それをインストールしました。(名前は覚えてません;) その後VS2015を再起動しました。 プロジェクト名というのは、ソリューションエクスプローラで、 ZV3.NativeActivity ZV3.Packaging となっている場合は、「ZV3」のことですよね。 フォルダは↓のようにし、 ZV3.Packaging→src→com→ZV3→Packaging→ZV3.java ZV3.javaソースの先頭が↓で、 package com.ZV3.Packaging; クラス名を、↓にしました。 public class ZV3 extends NativeActivity Unicode (UTF-8 シグネチャなし) - コードページ 65001にもしてあります。 AndroidManifest.xmlはこちら↓ ======================= <?xml version="1.0" encoding="utf-8"?> <!-- Changes made to Package Name should also be reflected in the Debugging - Package Name property, in the Property Pages --> <manifest xmlns:android="*ttp://schemas.android.com/apk/res/android" package="com.giw02" android:versionCode="1" android:versionName="1.0"> <!-- This is the platform API where NativeActivity was introduced. --> <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19"/> <!-- Socket --> <uses-permission android:name="android.permission.INTERNET" /> <!-- This .apk has no Java code itself, so set hasCode to false. --> <application android:label="@string/app_name" android:hasCode="false" android:theme="@android:style/Theme.NoTitleBar" android:icon="@drawable/icon"> <!-- Our activity is the built-in NativeActivity framework class. This will take care of integrating with our NDK code. --> <activity android:name="com.ZV3.Packaging.ZV3" android:label="@string/app_name" android:configChanges="orientation|screenSize" android:launchMode="singleInstance" android:screenOrientation="landscape"> <!-- <activity android:name="android.app.NativeActivity" android:label="@string/app_name" android:configChanges="orientation|screenSize" android:launchMode="singleInstance" android:screenOrientation="landscape"> --> <!-- Tell NativeActivity the name of our .so --> <meta-data android:name="android.app.lib_name" android:value="$(AndroidAppLibName)"/> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest> ======================= (掲示板の関係で、httpを*ttpにしてます) これを実行すると、起動時にエラーになります。 ↓を戻すと、ゲーム自体は正常に動作します。 <!-- <activity android:name="android.app.NativeActivity" android:label="@string/app_name" android:configChanges="orientation|screenSize" android:launchMode="singleInstance" android:screenOrientation="landscape"> --> 以上です。 何か原因がわかりましたら教えてください;
メンテ

Page: 1 |

Re: Android:文字入力 ( No.1 )
名前:ギウ 日時:2017/06/14 10:37

あ、新しくインストールしたのは、 ↓でした。 =========== Java Language Service for Android and Eclipse Android Project Import *ttps://marketplace.visualstudio.com/items?itemName=VisualCPPTeam.JavaLanguageServiceforAndroidandEclipseAndroidProj ===========
メンテ
Re: Android:文字入力 ( No.2 )
名前:管理人 日時:2017/06/14 23:56

載せていただいた AndroidManifest.xml のこちらの部分 <application android:label="@string/app_name" android:hasCode="false" android:theme="@android:style/Theme.NoTitleBar" android:icon="@drawable/icon"> hasCode="false" は、JAVAコードを使用する場合は hasCode="true" となります これだけで解決するか分かりませんが、よろしければお試しください m(_ _)m
メンテ
Re: Android:文字入力 ( No.3 )
名前:ギウ(解決) 日時:2017/06/15 09:58

ああ! trueを見落としてました! ということで解決しました。 ご指摘有難うございます!
メンテ

Page: 1 |

題名
名前
コメント
パスワード (記事メンテ時に使用)

   クッキー保存