I have a GWT Java based AppEngine project that uses blobstore for mp3 files. To stream the blobs, I normally call my serve HttpServlet by passing something like "/myApp/serve?blob-key=AMIfv... " to GWT Audio widget. The code is the same for dev server or deployed.
Now I'm trying an android client with MediaPlayer, but I'm having problems with the URLs passed to to MediaPlayer.setDataSource().
For a deployed server, this URL works ok: http://example.appspot.com/myApp/serve?blob-key=AMIfv...
but I can't get dev mode to work. As far as I can tell, the server is running at http://localhost:8888/
so I pass: http://localhost:8888/myApp/serve?blob-key=AMIfv...
but the servlet is never reached (I tried numerous variations).
Is there a better approach for reaching & defining a changing backend? similar to that for datastore objects as provided by Endpoints Support to Android clients ? https://developers.google.com/eclipse/docs/endpoints-android Here if we set LOCAL_ANDROID_RUN to true (in CloudEndpointUtils.java), the Android application connects to the local development server. If LOCAL_ANDROID_RUN is false the client libraries provide the correct URL depending on the application ID.
CloudEndpointUtils.java (from the appengine connected android wizard) defines LOCAL_APP_ENGINE_SERVER_URL = "http://localhost:8888/"
. This loopback address doesn't work for the emulator or real android. For both cases, a real interface address, eg http://192.168.1.2:8888
gives connection to the devappserver datastore endpoints & blobstore. For the emulator, you can use 10.0.2.2 which is the emulator's virtual router alias for the host computer's loopback interface.