bminortx / Android-PLY-Reader

OpenGL ES-powered .ply reader for Android!
Apache License 2.0
20 stars 2 forks source link

Unable to load .ply file from server url ? #5

Open jagadish482 opened 7 years ago

jagadish482 commented 7 years ago

hi , I changed your code at

plyInput = context.getResources().openRawResource(R.raw.scene_dense_mesh_refine_texture); (in GLVIEW.java)

with

try { plyInput = new URL("http://10.0.2.2:8888/uploads_jagadish/mvs/scene_dense_mesh_refine_texture.ply").openStream(); } catch (MalformedURLException ex) { Log.e("glview", "URL error: " + ex.getMessage(), ex); } catch (IOException ioe) { Log.e("glview", "IO error: " + ioe.getMessage(), ioe); }catch (NullPointerException e){ Log.e("glview", "IO error: " + e.getMessage(), e); }

but i am getting below errors, please help me to solve this.

2-27 17:51:47.681 13179-13179/? E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.graphics.openglgui, PID: 13179 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.graphics.openglgui/com.graphics.openglgui.MeshViewActivity}: android.view.InflateException: Binary XML file line #22: Error inflating class com.graphics.openglgui.GLView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class com.graphics.openglgui.GLView at android.view.LayoutInflater.createView(LayoutInflater.java:633) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at android.view.LayoutInflater.inflate(LayoutInflater.java:365) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378) at android.app.Activity.setContentView(Activity.java:2145) at com.graphics.openglgui.MeshViewActivity.onCreate(MeshViewActivity.java:17) at android.app.Activity.performCreate(Activity.java:5990) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)             at android.app.ActivityThread.access$800(ActivityThread.java:151)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:135)             at android.app.ActivityThread.main(ActivityThread.java:5257)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.view.LayoutInflater.createView(LayoutInflater.java:607)             at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)             at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)             at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)             at android.view.LayoutInflater.inflate(LayoutInflater.java:504)             at android.view.LayoutInflater.inflate(LayoutInflater.java:414)             at android.view.LayoutInflater.inflate(LayoutInflater.java:365)             at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)             at android.app.Activity.setContentView(Activity.java:2145)             at com.graphics.openglgui.MeshViewActivity.onCreate(MeshViewActivity.java:17)             at android.app.Activity.performCreate(Activity.java:5990)             at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)             at android.app.ActivityThread.access$800(ActivityThread.java:151)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:135)             at android.app.ActivityThread.main(ActivityThread.java:5257)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: android.os.NetworkOnMainThreadException at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1147) at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:110) at libcore.io.IoBridge.connectErrno(IoBridge.java:137) at libcore.io.IoBridge.connect(IoBridge.java:122) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:456) at java.net.Socket.connect(Socket.java:882) at com.android.okhttp.internal.Platform.connectSocket(Platform.java:174) at com.android.okhttp.Connection.connect(Connection.java:152) at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276) at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211) at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382) at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332) at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:199) at java.net.URL.openStream(URL.java:470) at com.graphics.openglgui.GLView$Renderer.(GLView.java:113) at com.graphics.openglgui.GLView.(GLView.java:41)             at java.lang.reflect.Constructor.newInstance(Native Method)             at java.lang.reflect.Constructor.newInstance(Constructor.java:288)             at android.view.LayoutInflater.createView(LayoutInflater.java:607)             at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)             at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)             at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)             at android.view.LayoutInflater.inflate(LayoutInflater.java:504)             at android.view.LayoutInflater.inflate(LayoutInflater.java:414)             at android.view.LayoutInflater.inflate(LayoutInflater.java:365)             at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)             at android.app.Activity.setContentView(Activity.java:2145)             at com.graphics.openglgui.MeshViewActivity.onCreate(MeshViewActivity.java:17)             at android.app.Activity.performCreate(Activity.java:5990)             at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)             at android.app.ActivityThread.access$800(ActivityThread.java:151)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:135)             at android.app.ActivityThread.main(ActivityThread.java:5257)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 12-27 17:51:48.592 13179-13191/com.graphics.openglgui I/art﹕ WaitForGcToComplete blocked for 11.063ms for cause Background