locked
how to use APK Expansion file(.obb) html into webview in xamarin form ? like as bellow RRS feed

  • Question

  • User399000 posted

    var files = APKExpansionSupport.GetAPKExpansionZipFile(this, 27, 27); Webview.Source = files.GetInputStream("Offline_Files/default.html");

    Saturday, January 16, 2021 1:39 PM

All replies

  • User382871 posted

    Try to get file stream with the following code on Android platform. var file = APKExpansionSupport.GetAPKExpansionZipFile(this,1,2); var stream = file.GetInputStream(path); Then convert the stream to html string and set it as the webView's source in the shared project. ``` Stream stream = DependencyService.Get().Get(); ;

    string content; using (var reader = new StreamReader(stream)) { content = reader.ReadToEnd(); }

    var htmlSource = new HtmlWebViewSource(); htmlSource.Html = content; webView.Source = htmlSource; ```


    Xamarin forums are migrating to a new home on Microsoft Q&A! We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A! For more information, please refer to this sticky post.

    Monday, January 18, 2021 9:16 AM
  • User382871 posted

    @anbalaghan Hi, any updates? If you've solved the problem, please accept the helpful reply as the answer. It'll help others who face the similar problem. If you are facing some issues while implementing, try to post the particular error with the corresponding codes here.


    Xamarin forums are migrating to a new home on Microsoft Q&A! We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A! For more information, please refer to this sticky post.

    Tuesday, February 2, 2021 8:39 AM