Url is loading in WebView Android - android-webview

I have a webview and i am trying to load url in this view now when i run this activity its giving warnigs and after sometime its crahing.
09-05 15:47:34.277: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:47:34.277: D/TilesManager(9057): new EGLContext from framework: 5c7252f0
09-05 15:47:34.277: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:47:34.277: D/GLWebViewState(9057): Reinit shader
09-05 15:47:34.284: D/GLWebViewState(9057): Reinit transferQueue
09-05 15:48:01.800: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:48:01.800: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:48:21.613: I/dalvikvm(9057): threadid=3: reacting to signal 3
09-05 15:48:21.652: I/dalvikvm(9057): Wrote stack traces to '/data/anr/traces.txt'
09-05 15:48:29.855: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:48:29.863: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:48:57.409: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:48:57.417: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:49:24.933: I/Choreographer(9057): Skipped 1623 frames! The application may be doing too much work on its main thread.
09-05 15:49:24.933: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:49:24.941: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:49:53.542: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:49:53.542: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:50:22.183: I/Choreographer(9057): Skipped 1688 frames! The application may be doing too much work on its main thread.
09-05 15:50:22.183: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:50:22.183: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:50:49.558: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:50:49.558: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:51:18.628: I/Choreographer(9057): Skipped 1714 frames! The application may be doing too much work on its main thread.
09-05 15:51:18.636: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:51:18.636: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:51:47.769: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:51:47.769: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:52:16.777: I/Choreographer(9057): Skipped 1711 frames! The application may be doing too much work on its main thread.
09-05 15:52:16.784: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:52:16.784: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:52:46.909: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:52:46.909: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
09-05 15:53:15.550: I/Choreographer(9057): Skipped 1688 frames! The application may be doing too much work on its main thread.
09-05 15:53:15.550: W/GLWebViewState(9057): WARNING, scale seems corrupted before update: 2.000000e-02
09-05 15:53:15.550: W/GLWebViewState(9057): WARNING, scale seems corrupted after update: 2.000000e-02
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<WebView
android:id="#+id/webView_links"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
/>
</LinearLayout>
mWebView = new WebView(this);
mWebView = (WebView) findViewById(R.id.webView_links);
PIC_WIDTH= mWebView.getRight()-mWebView.getLeft();
mWebView.setPadding(0, 0, 0, 0);
mWebView.setInitialScale(2);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setHorizontalScrollBarEnabled(false);
mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
mWebView.setWebViewClient(new WebViewClient() {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(mCurrentUrl != null && url != null && url.equals(mCurrentUrl)) {
mWebView.goBack();
return true;
}
view.loadUrl(url);
mCurrentUrl = url;
return true;
}
#Override
public void onPageFinished(WebView view, String url) {
//heading.setText(view.getTitle());
}
});
Log.i("----------------------------------",""+extras.getString("link_address"));
mWebView .loadUrl("http://www.alinadental.com/");

Related

How to run two separate ARKit experiences in one iOS app

I have a problem with running two ARKit experiences in one app. I have main menu View Controller which runs either of the experiences. It looks something like that:
MainVC - main UIViewController with two buttons to choose the experience
ARVC1 - first experience UIViewController
ARVC2 - second experience UIViewController
Both experiences are independent and they don't need to pass any data between each other.
Unfortunately when I dismiss ARVC1 or ARVC2 and run the second one, somehow I have traces of the previous ARSession (still frame from previous session is flashing once for a while). Can I reset completely ARSession somehow? It seems that it stays somewhere in the background. I've tried to pause the session when I dismiss any of the View Controllers but it didn't help.
The same happens if I open ARVC1 and press the button to show statistics:
arView.debugOptions = [.showStatistics]
After dismissing ARVC1 and opening it again it still shows statistics so it's running somewhere in the background.
I found the solution to my problem:
After opening and closing ARVC1 and quickly opening ARVC2 I was experiencing flickering of the previous ARSession in current ARSession. To solve this I create ARView in my MainVC and I pass the reference to it to destination controller, where I set up the arView constraints programmatically. To avoid passing the ARAnchors I reset configuration with options in viewDidLoad:
arView.session.run(configuration, options: [.resetTracking,.removeExistingAnchors,.stopTrackedRaycasts])
It helped as well with UINavigationController transition (made it smoother) because ARSession is configured before the View is presented and it eliminates the black flash that occurs at the moment when you run new ARConfiguration with ARSession.
It also eliminates the console error (below) that I was experiencing while quickly closing and opening ViewController containing ARView which sometimes was crashing the app:
[Session] Session (0x160879b40): did fail with error: Error
Domain=com.apple.arkit.error Code=102 "Required sensor failed."
UserInfo={NSLocalizedFailureReason=A sensor failed to deliver the
required input., NSUnderlyingError=0x283f959b0 {Error
Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be
completed" UserInfo={NSLocalizedFailureReason=An unknown error
occurred (-12780), NSLocalizedDescription=The operation could not be
completed, NSUnderlyingError=0x283efc8a0 {Error
Domain=NSOSStatusErrorDomain Code=-12780 "(null)"}}},
NSLocalizedRecoverySuggestion=Make sure that the application has the
required privacy settings., NSLocalizedDescription=Required sensor
failed.} 2020-01-09 16:20:38.600835+0000 App[573:231750]
[Technique] World tracking performance is being affected by resource
constraints [3] 2020-01-09 16:20:38.600977+0000
App[573:231750] [Technique] VIO error callback: 8506.590769,
3, Frame time stamps are either out of order or repeating

Saving the video when app is interrupted by call

I setup and use AVAssetWriterInput --- AVAssetWriter chain to record a video. This works fine.
When the video recording is stopped, AVAssetWriter's finishWriting returns a status saying it is Completed.
However, if the recording is interrupted by a call then the finishWriting status says it is Failed and the video is not saved.
To fix this issue, following line of code is used.
self.assetWriter.movieFragmentInterval = CMTimeMakeWithSeconds(1.0, 1000000000);
Here, even if the status says Failed, the video is saved.
Will this affect the performance, as the header is now added at regular intervals to the recording video?
Also, is it right to hard code the values say, 1000000000?
Thanks in advance for your time and help.

Assertion Failure in -[CCSprite setTexture:]

I am having a problem with a cocos2d app for IPhone I am developing. The prolem comes out sometimes during a scene change. The app stucks and the console starts printing this statement:
Assertion failure in -[CCSprite setTexture:]
I would like you to suggest me the right way to debug it since the problem does not always happen and there is not a precise indication of where the bug might be.
Thank you in advance
... some hours after: The problem occurs after a memory warning. It its therefore due to the sprite cache which is flushed while an animation is exploiting a cached texture atlas and related sheet. What can I do to handle it?
I would set a breakpoint in [CCSprite setTexture:] and from there check the stack trace and go back to your offending call. Of course, this will only succeed in case the failure occurs.
In my cocos2d installation (0.9.5), asserts in setTexture can be:
NSAssert( ! usesBatchNode_, #"CCSprite: setTexture doesn't work when the sprite is rendered using a CCSpriteBatchNode");
// accept texture==nil as argument
NSAssert( !texture || [texture isKindOfClass:[CCTexture2D class]], #"setTexture expects a CCTexture2D. Invalid argument");
So you are doing either of those wrongly.
EDIT after you comment:
your appDelegate defines presumably:
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
[[CCDirector sharedDirector] purgeCachedData];
}
try using:
[[CCTextureCache sharedTextureCache] removeUnusedTextures];
instead of [[CCDirector sharedDirector] purgeCachedData]. Hope things will improve.

Saving file to disk while running AVCaptureVideoPreviewLayer and CMMotionManager

Good day, hope someone can help me up with this situation:
I working on an iPhone app that takes series of images, assisted by gyroscope.
So both AVCamCaptureManager and CMMotionManager sessions are running at the same time.
after taking a still image, i am:
- processing the image in a background thread (which works fine without affecting anything)
- then saving processed image data to disk
[imageData writeToFile:imagePath atomically:YES];
The issue: both AVCamCaptureManager and CMMotionManager sessions freeze for less then 1/2 second, right after initiating writeToFile function.
Does anyone have any experience with such scenario?
Thanks for your time! :)
It appears that saving to disk does not affect sessions.
I am also setting UIImageView.image to a large image in the end of my routine, and this is what was freezing everything for 1/2 second.

Audio will play in 3.2 sim but not in 4.x

This streaming audio app will play in 3.2 simulator, but not in 4.x sim or my 4.1 iPhone.
The console logs are as follows:
4.0 Sim
This GDB was configured as "x86_64-apple-darwin".Attaching to process 13237.
[Switching to process 13237]
2010-11-15 19:54:49.606 Issues[13237:1c07] AddRunningClient starting device on non-zero client count
2010-11-15 19:55:16.220 Issues[13237:6307] AQMEIO_Base::DoStartIO: timeout
2010-11-15 19:55:16.498 Issues[13237:6307] AQMEDevice::StartIO: error -66681
2010-11-15 19:55:16.499 Issues[13237:6307] CA_UISoundClientBase::StartPlaying: AddRunningClient failed (status = -66681).
2010-11-15 19:55:46.499 Issues[13237:1c07] AQMEIO_Base::DoStartIO: timeout
2010-11-15 19:55:46.777 Issues[13237:1c07] AQMEDevice::StartIO: error -66681
2010-11-15 19:55:46.778 Issues[13237:1c07] Audio queue start failed. err: ˇ˛˚á -66681
[Switching to process 13237]
4.1 Device
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys001
target remote-mobile /tmp/.XcodeGDBRemote-11399-40
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
[Switching to thread 13059]
[Switching to thread 11523]
If it makes you feel better, I have had this exact problem for a couple weeks with no solution in sight. I think it occurred when I upgraded my ipad to 4.2 but I am not sure. I was still able to use the 3.2 simulator for my music app testing, but now I have been making my app universal and there is no way to test the iphone code on the simulator.
EDIT: I fixed it!!
The only other google search result for this error led me to poke around in my audio settings. I have a Blackmagic Intensity Pro HDMI capture card and it was set as my audio input device. I changed it to "Line in" or whatever, restarted my Mac, and then the simulator worked again!
I was also messing around with my audio output settings, so it's hard to know for sure what actually solved it, but the key is: mess around with your audio settings, restart your Mac and cross your fingers.
one more edit: I had this same problem occur with a webcam on my other, work computer. I changed the audio from the input of the web cam back to line in, and it worked again. How are more people not seeing this?
I had this problem, and fixed it by unplugging an external microphone which was hooked up via USB. Not sure why this fixed it, but it did.
I have the problem too, but i fixed it in some minutes, thank to Ethical. Although the problem is same, my code is different, my code supplie in the video player. My code run good in the ipad/iphone device, but not in simulator. When the video start playing, the simulator freezon, the output is like you, but i remember i plug in the earphone just now, and pull out some miniutes later, so the setting of audio player changed, i think. So, i plug in the earphone again and restart my mac. The problem solved. So just restart your mac, or check the setting of audio player.
+1 .... Checking and changing the Mac's audio input also worked for me. I had no sound in the simulator (Mac Pro) but my app worked fine on the device (iPad 3) calling
[[SimpleAudioEngine sharedEngine] playEffect:#"soundname.caf"];
In the sim, there was a long lag after first trying to play a sound (my app seemed to hang, with high CPU usage). After a long time it would give a AQMEIO_Base::DoStartIO: timeout error and the app would resume, albeit without sound. Happened every time I ran it.
The sound output was shown as line out, but sound input was set to digital. Changing the input to line in made sound work in the simulator.
There is still a cascade of warnings in the sim on startup, starting with:
Error loading
/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:
dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn,
262): Symbol not found: ___CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
and ending in
Default audio device changed. Restart the simulator to have it use the newly-selected device.
But sound now works and I can test the app using the simulator.
Try to play your audio on MPMovidePlayerController instead of MPMediaPlayer