0
0

python-flaskとdart-flutterのandroidえみゅでのWebsocket通信で躓いた話

Posted at

はじめに

こないだの大阪技育2023のときにタイトル通りに躓いてた。
大阪技育ではてくてくてっくという二人チームで、タスクメイドというリーダーとメンバーでメイドを板挟みにしてタスクを管理してもらうアプリを出しました。
相方の圧倒的プレゼンと始めたばかりとは思えないflutterとメイドパワーで最優秀賞いただきました。ありがとうございます。

結論

androidからみてlocalhostはandroid自身なので、仮想ルータがホストOSに割り振っているIPを指定するといいと教えてもらった。

公式:
Android Emulator のネットワークをセットアップする
[https://developer.android.com/studio/run/emulator-networking?hl=ja]

具体的な実装方法が載ってるサイト:
Androidのエミュレーターから自身のPC(localhost)へ接続
[https://araramistudio.jimdo.com/2018/01/11/android%E3%81%AE%E3%82%A8%E3%83%9F%E3%83%A5%E3%83%AC%E3%83%BC%E3%82%BF%E3%83%BC%E3%81%8B%E3%82%89%E8%87%AA%E8%BA%AB%E3%81%AEpc-localhost-%E3%81%B8%E6%8E%A5%E7%B6%9A/]

Flutterを使いAndroidのエミュレーターでローカルホストに接続
[https://note.com/_hi/n/n0dfe96c434e8]

【Android】エミュレータでホストOSのWebサーバに接続する
[https://atsum.in/android/access-host/]

環境

VScodium
拡張: dart, flutter
えみゅ: Pixel 6a API 33

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0