locked
How to display image in mobile RRS feed

  • Question

  • User387015 posted

    l am consuming an api hosted on my local computer in my mobile app. l have successfully displayed other attributes except such as title,date_created but am having a challenge displaying the image. l saved the image in a folder and saved the path to the image in the database. l got the path to the image by clicking on the image in visual studio. l copied the full path and saved in the database. the image is not displaying. Is there a reason why.

    This is the full path in the database C:\Users\SBSC QA TEAM\source\repos\FINALKAHPROJECT\FINALKAHPROJECT\FINALKAHPROJECT\IMAGES\spider.jpeg

    Monday, October 28, 2019 10:39 AM

Answers

  • User74 posted

    Your mobile app won't have access to a file stored on your PC. You can embed the file into your solution and make it available at runtime, or host it on a web server and retrieve it that way.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, October 28, 2019 11:08 AM

All replies

  • User74 posted

    Your mobile app won't have access to a file stored on your PC. You can embed the file into your solution and make it available at runtime, or host it on a web server and retrieve it that way.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, October 28, 2019 11:08 AM
  • User387015 posted

    thanks @JohnH. l could not embed the image into the solution. l attempted embedding the image into the solution by selecting the image and setting build action to embedded resource.it didn't work. so l decided to host the image on a web server and saved the url in the database. That worked perfectly. Question is why did the embedded option not work.

    l got the full path of the image by right clicking on the image and clicking on properties. l then copied the value of full path and saved in the db. Below is what l saved in the db C:\Users\SBSC QA TEAM\source\repos\FINALKAHPROJECT\FINALKAHPROJECT\FINALKAHPROJECT\wwwroot\images\spider.jpeg.

    Is this the issue..if yes how do l get the path.thanks

    Wednesday, October 30, 2019 11:29 AM
  • User74 posted

    Take a look at the Xamarin examples on embedding images, the process is different on each platform. The original path og where the file was at compile time makes no difference to the location where the file is embedded, so it wouldn't have that path.

    Wednesday, October 30, 2019 1:28 PM