Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
FileInputStreamを使用して値を読み取るコードでtxtファイルを参照しようとしていますが、パスの設定方法がわからないため、「C:\ ...\file」と具体的に入力する必要はありません。 .txt」をコンストラクターに追加します。私はそれを行う方法があることを知っています私はそれをどこにも見つけることができないようです。APIは少し曖昧で、ドキュメントからは完全に理解できませんでした。
これにタグを付けましたandroid。だから私はあなたがそれに取り組んでいると仮定します。
android
そのテキストファイルをあなたのrawまたはassetsあなたのresフォルダのフォルダに入れてください。
raw
assets
res
getResources().openRawResource()これらのファイルには、それぞれとを使用してアクセスできますgetResources().getAssets()。
getResources().openRawResource()
getResources().getAssets()