I am trying to create an app (to be specific a catholic prayer) from old printed book(No copyrights violation involved ).
Since i am newbie to Android app development, i think the easiest way (for me ) to do this for me as follows
01. create web page with scan images from that book, and use phone gap to generate android version of this webpage.
My problem is this: Once i generated the android version , i was not able to see the image files. instead of that i can see only ? mark.
I want images to store in locally(inside the phone) with the app so once users download this will not required to have an active internet connection to display those images.
I have added the web page preview and screen shot from my android phone
.
Please help me to fix this issue.
Thank you.
First look at the debug.
Don't forget to add
<uses-permission android:name="android.permission.INTERNET" />
Add this to make a new Webview.
WebView webview = new WebView(this);
setContentView(webview);
webview.loadUrl("Your URL");
Otherwise try this tutorial:
http://www.technotalkative.com/android-webviewclient-example/
Related
We have no knowledge of mobile applications. We need to convert a basic web-based database management application in Laravel into a mobile application. Is there a way to do it without having mobile application developers. The application has the following views
1. Form
2. Edit form
2. All forms
3. Users
4. Edit Users
There are two user type - Admin and data entry operator
Yes, you can do it using webview. Start a project in android studio, create a class extending from Activity, a xml layout file in res/layout, and take a look on your AndroidManifest file in the manifests folder.
It will look more or less like this:
The image also shows you the basic structure of the activity, though you don't really need the onCreateOptionsMenu part. Now to make the webview put this in the xml:
<WebView
android:id="#+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
And call it on your onCreate method like the one shown in the image:
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://www.example.com"); //change the link to your
In your manifest add permission for the application to use internet:
<manifest ... >
<uses-permission android:name="android.permission.INTERNET" />
...
</manifest>
If you want to make your webview work offline you could use webview cache.
But since it is a database managing application, you probably will need to make a full app, and for that you will need an mobile developer. But you could use other approaches, like using xamarin, ionic or other transpilers, though that will still require learning, it is easier for programmers of other areas to adapt, then maybe you could avoid hiring a mobile programmer.
I'm looking for a possibility to browse the android API guides offline (with figures). I read several questions about this here (ex. 1, 2, 3...) and tried to get offline docs from the sdk folder or using a direct link. The problem with the actual version (23_r01) is that the images are often not displayed. For example in the page sdk/docs/design/index.html the image hero-material-design.png could not be displayed because of a bad src tag.
What I've tried:
Using the docs from the SDK folder
Direct download from https://dl-ssl.google.com/android/repository/docs-23_r01.zip
Saving the files using HTTrack (I'm getting errors here..)
What I would like to achive:
Download a correct version of the docs
OR "Repair" all the broken image paths in the html files
I would appreciate any help.
If thats still interested to you, just edit \docs\design\index.html, add .. before /design (it means the parent folder, one dot means the current), like that:
<img class="dac-hero-image" src="../design/media/hero-material-design.png">
So here's my problem. I made a website, which by popular demand, people want it to be an app on there phone (because apparently people are to lazy to google it and use precious internet :3 )
So I did some research and came across the android webview, and after a few tutorials I got my website working as an app. However this app still needed internet.
So I tried to just put my website files (Which are inside a folder called version) inside the android res folder
WebView/app/src/main/res/
But when I try to access it with the following code
String url = "/res/version/english.html";
WebView view = (WebView) this.findViewById(R.id.webView);
view.getSettings().setJavaScriptEnabled(true);
view.loadUrl(url);
It comes up with the "Webpage not available" message.
Does anyone know how I can fix this. Thanks
My suggestion would be to look into Cardova or PhoneGap. They provide extremely robust tools to program with HTML, CSS, Javascript, etc and then acts as a native bridge between Java or Objective-C if you're developing for iPhone.
You will still have access to many of the core native API's such as Camera, Accelerometer, etc. My company uses these religiously as we mostly have web developers on staff. I would highly suggest it.
I figured out what I did wrong. First off, I needed to add this at the start of it
"file:///"
Then I needed to make an assets folder, and then put all my files into it. And the last mistake, I need to access the access folder by doing this
"file://android_assest/*"
Ok, there's a long history behind this one, but the gist is that we need to create and download a little bit of text CLIENT side, into a file called "test.lbl". Assume we can't access the server side.
The following code (coffeescript) does this by creating a Blob, converting it to a data url, and then clicking the link. This works GREAT in a desktop Chrome browser. However, in Android Chrome (not sure what version exactly, but I just installed it as of 3/5/13 from Google App Store) this simply won't work. In Android Chrome, the file starts to download and then just spins. (In fact, it shows in your "Ongoing" for quite some time, even after the browser is closed.)
Anyone know why this might not work in Android? Perhaps a different mime type will make it allow the file to be downloaded? We're dealing with internal tablets so we can relax any site specific security settings we need to.
Or, is there a better way to go about this entirely? (client-side generated text file download)
Thanks
$("#get-label").on 'click', (e) ->
e.preventDefault()
bb = new Blob(['test test test'], {type:'text/plain'})
evt = document.createEvent("HTMLEvents")
evt.initEvent("click")
$("<a>", {download: 'test.lbl', href: webkitURL.createObjectURL(bb)}).get(0).dispatchEvent(evt)
This is a known issue in Chrome for Android. I have raised an issue https://code.google.com/p/chromium/issues/detail?id=181032 - if you star that you will be able to see all the updates for it.
I was trying to display a webpage of a url on a plain WebView, and some of the images are not showing. However, everything shows up fine in the browser for the simulator.
Is there a difference between the rendering via WebView vs. the Android 2.3 Browser?
There are several things added to the Android browser. They add things in to handle JavaScript, to handle switching to native functionality for videos, etc. Luckily the Browser is open source so you can get the Android code base and see what they do.
Yes could be a difference. If you are passing the web text-plain to the webview directly it doesn't understand the images which are references depending the local path instead the goblal path reference.
I mean, if you have a <img src="/images/image.png" /> here you are referencing depending on your directory, and the browser try to look up image.png into your root, and if you have <img src="http://www.whatever.com/images/image.png" /> then you are referencing it globaly. So I think this is the main that you could have.