Sunil,

You should not have developed your http server, but utilise some OSS
project that does that.
Your links to images or any other resource are relative to the context
of that web page (or web application) running within your web server.

wwwroot
 - websiteA
    -images
      -topWrapper-bg.jpg
      - ...
    -css
    -javascript
 - websiteB
 - websiteC
-index.html

To achieve this, your server has to do translation from URL
'images/topWrapper-bg.jpg' to a file path within your storage
'/yourstorage/yourwebserver/wwwroot/webisteA/images/topWrapper-bg.jpg'.

Without this, you are dead in the water.

Just use ready, mature and testes OSS HTTP server written in Java.

Here is one option. Just package it into your application. It is only 4kB:

http://www.jibble.org/miniwebserver/

Daniel











On 11 November 2011 11:27, Sunil Mishra <[email protected]> wrote:
> I tried changing background-image:url('images/css/topBanner.jpg') to
> background-image:url(file://android_asset/raw/images/css/
> topBanner.jpg' ) but it still not working.
>
> On Nov 11, 4:20 pm, Miguel Morales <[email protected]> wrote:
>> They sure are.
>>
>> On Fri, Nov 11, 2011 at 3:14 AM, Sunil Mishra <[email protected]>wrote:
>>
>>
>>
>>
>>
>>
>>
>> > The images are in res->raw->images->css
>>
>> > On Nov 11, 3:38 pm, Miguel Morales <[email protected]> wrote:
>> > > That's better, most likely you'll want to put your html/images in the res
>> > > folder and then user the following path:
>>
>> > > file://android_asset/file_path.png
>>
>> > > If you are downloading these files dynamically, then simply change the
>> > > file:// path.
>>
>> > > On Fri, Nov 11, 2011 at 2:30 AM, Sunil Mishra <[email protected]
>> > >wrote:
>>
>> > > > home.html
>>
>> > > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
>> > > >www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>
>> > > > <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">
>> > > >  <head>
>> > > >    <title>ODMS</title>
>> > > >    <meta http-equiv="Content-Type" content="text/html;
>> > > > charset=utf-8" />
>> > > > <style type = "text/css">
>> > > > html {
>> > > >        background: #d2d2d2;
>> > > >        margin:0 0 0 -1px;
>> > > >        padding:0;
>> > > >        overflow-Y: scroll;
>> > > > }
>>
>> > > > body {
>> > > >        padding:0;
>> > > >        margin :0;
>> > > >        display:table;
>> > > >        width:100%;
>> > > > }
>>
>> > > > body {
>> > > >        color:#606060;
>> > > >        font-family: 'Trebuchet MS', sans-serif;
>> > > >        font-size: 13px;
>> > > >        font-style: normal;
>> > > >        font-weight: normal;
>> > > >        text-transform: normal;
>> > > > }
>>
>> > > > p {
>> > > >        letter-spacing: normal;
>> > > >        line-height: 1.7em;
>> > > > }
>>
>> > > > h1 {
>> > > >        color:#505050;
>> > > >        font-size:22px;
>> > > >        margin:25px 0 10px 0;
>> > > >        clear:both;
>> > > > }
>>
>> > > > h2 {
>> > > >        color:#505050;
>> > > >        font-size:20px;
>> > > >        margin:20px 0 10px 0;
>> > > >        clear:both;
>> > > > }
>>
>> > > > h3 {
>> > > >        color:#505050;
>> > > >        font-size:18px;
>> > > >        margin:20px 0 5px 0;
>> > > >        clear:both;
>> > > > }
>>
>> > > > a:link, a:visited {
>> > > >        color:#9B251B;
>> > > >        text-decoration:none;
>> > > > }
>>
>> > > > a:hover {
>> > > >        color:#fa720a;
>> > > >        text-decoration:underline;
>> > > > }
>>
>> > > > #wrapper {
>> > > >        background: transparent url( images/css/page-vbg.jpg ) repeat-y
>> > > > scroll 50% 0px;
>> > > >        margin:0 auto ;
>> > > >        width:100%;
>> > > > }
>>
>> > > > body {
>> > > >        background-color:#d2d2d2;
>> > > > }
>>
>> > > > #wrapper {
>> > > >        border-top: 1px solid #ffffff;
>> > > > }
>>
>> > > > #topWrapper {
>> > > >        width:100%;
>> > > >        height:240px;
>> > > >        background-color:${topWrapper.bg.color};
>> > > >        background-image:url(images/css/topWrapper-bg.jpg);
>> > > >        background-position:center top ;
>> > > >        background-repeat:repeat-x;
>> > > > }
>>
>> > > > #topBanner {
>> > > >        width:960px;
>> > > >        margin:0 auto;
>> > > >        height:240px;
>> > > >        background-image:url('images/css/topBanner.jpg');
>> > > >        background-repeat:no-repeat;
>> > > > }
>>
>> > > > #topnav {
>> > > >        background:transparent url('images/css/hmenu.jpg') repeat-x top
>> > > > left;
>> > > > }
>>
>> > > > #topnav {
>> > > >        height:40px;
>> > > >        margin:0 auto ;
>> > > >        text-align:center;
>> > > > }
>>
>> > > > #topnav ul {
>> > > >        display:table;
>> > > >        margin:0 auto;
>> > > >        padding:0;
>> > > >        list-style-type:none;
>> > > >        position:relative;
>> > > >        height:40px;
>> > > >        text-transform:uppercase;
>> > > >        font-size:12px;
>> > > >        font-family:Arial,sans-serif;
>> > > > }
>>
>> > > > #topnav ul li {
>> > > >        display:block;
>> > > >        float:left;
>> > > >        margin:0;
>> > > >        padding:0;
>> > > >        background:transparent url('images/css/hmenu.jpg') repeat-x top
>> > > > left;
>>
>> > > > }
>>
>> > > > #topnav ul li a {
>> > > >        display:block;
>> > > >        float:left;
>> > > >        color:#eeb7b7;
>> > > >        text-decoration:none;
>> > > >        padding:0px 50px ;
>> > > >        line-height:40px;
>> > > >        font-weight:bold;
>> > > > }
>>
>> > > > #topnav ul li a:hover, #topnav li#current a {
>> > > >        color:#FFFFFF;
>> > > >        background:transparent url('images/css/hmenu-sel.jpg') repeat-x
>> > top
>> > > > left;
>> > > > }
>>
>> > > > #topnav ul {
>> > > >        width:960px;
>> > > > }
>>
>> > > > body {
>> > > >        background-position : center 280px;
>> > > > }
>>
>> > > > #bg {
>> > > >        margin:0 auto;
>> > > >        padding:0;
>> > > >        background:transparent ;
>> > > >        background-image:url(images/css/hat.jpg);
>> > > >        background-repeat:no-repeat;
>> > > >        background-position: center top ;
>> > > > }
>>
>> > > >                                        #header {
>> > > >        margin: 0 auto;
>> > > >        min-height:30px;
>> > > >        height: 30px;
>> > > >        width: 960px;
>> > > > }
>>
>> > > > #page {
>> > > >        background: transparent url( images/css/page-bg.jpg ) no-repeat
>> > > > center top;
>> > > > }
>>
>> > > > #container {
>> > > >        margin:0 auto;
>> > > >        width:960px;
>> > > > }
>>
>> > > > #content {
>> > > >        width:940px;
>> > > >        margin:0 auto ;
>> > > >        text-align:left;
>> > > >        min-height:400px;
>> > > > }
>>
>> > > > #content p {
>> > > >        text-align:justify;
>> > > > }
>>
>> > > > #footerWrapper {
>> > > >        margin:0 auto;
>> > > >        height:180px;
>> > > >        padding:0;
>> > > >        background:transparent url( images/css/footerWrapper-bg.jpg )
>> > no-
>> > > > repeat scroll center top;
>> > > > }
>>
>> > > > #footer {
>> > > >        margin:0 auto;
>> > > >        padding:0;
>> > > >        width:960px;
>> > > >        height:100px;
>> > > > }
>>
>> > > >                                        #footer {
>> > > >        color:#CCCCCC;
>> > > >        text-align:center;
>> > > > }
>>
>> > > > #footer a:link, #footer a:visited {
>> > > >        color:#EEEEEE;
>> > > > }
>>
>> > > > #footer a:hover{
>> > > >        color:#FFFFFF;
>> > > >        text-decoration:none;
>> > > > }
>>
>> > > > #right {
>> > > >        width:200px;
>> > > >        padding:10px 20px 20px 20px;
>> > > >        float:left;
>> > > > }
>>
>> > > > #center {
>> > > >        width:660px;
>> > > >        padding:10px 20px 20px 20px;
>> > > >        float:left;
>> > > > }
>>
>> > > > #content p {
>> > > >        margin-top:10px;
>> > > >        text-align:justify;
>> > > > }
>>
>> > > > #sidebar ul.vmenu {
>> > > >        list-style: none;
>> > > >        text-align: left;
>> > > >        margin: 7px 0px 8px 0px;
>> > > >        padding: 0;
>> > > >        text-decoration: none;
>> > > >        border-top: 1px solid #eeeeee;
>> > > > }
>>
>> > > > #sidebar ul.vmenu li {
>> > > >        list-style: none;
>> > > >        padding: 4px 0 4px 0px;
>> > > >        margin: 0 2px;
>> > > >        border-bottom: 1px solid #eeeeee;
>> > > > }
>>
>> > > > #sidebar ul.vmenu li a {
>> > > >        text-decoration: none;
>> > > >        color:#9B251B;
>> > > > }
>>
>> > > > #sidebar ul.vmenu li a:hover {
>> > > >        color:#d8d8f0;
>> > > > }
>>
>> > > > #sidebar ul.vmenu ul { margin: 0 0 0 5px; padding: 0; }
>> > > > #sidebar ul.vmenu ul li { border: none; }
>>
>> > > > a img {
>> > > >        border:none;
>> > > > }
>>
>> > > > .clear {
>> > > >        clear: both;
>> > > >        display: block;
>> > > >        overflow: hidden;
>> > > >        visibility: hidden;
>> > > >        width: 0;
>> > > >        height: 0;
>> > > > }
>>
>> > > >  </style>
>>
>> > > >  </head>
>> > > >  <body>
>> > > >    <!-- top wrapper -->
>> > > >    <div id="topWrapper">
>> > > >      <div id="topBanner"></div>
>> > > >    </div>
>> > > >    <div id="topnav">
>> > > >      <ul>
>> > > >        <li id="current" style="border:none">
>> > > >          <a href="" shape="rect">Home</a>
>> > > >        </li>
>> > > >        <li>
>> > > >          <a href="/about" shape="rect">About</a>
>> > > >        </li>
>> > > >        <li>
>> > > >          <a href="/dir" shape="rect">Browse Content</a>
>> > > >        </li>
>> > > >      </ul>
>> > > >    </div>
>> > > >    <!-- end top wrapper -->
>> > > >    <div id="wrapper">
>> > > >      <div id="bg">
>> > > >        <div id="header"></div>
>> > > >        <div id="page">
>> > > >          <!-- begin container -->
>> > > >          <div id="container">
>> > > >            <!--  content -->
>> > > >            <div id="content">
>> > > >              <div id="center">
>> > > >                <div id="welcome">
>> > > >                  <h3>Welcome</h3>
>> > > >                  <p>Some Text Some Text Some Text Some Text Some Text
>> > > > Some Text Some Text Some Text Some Text Some Text
>> > > >                  Some Text Some Text Some Text Some Text Some Text
>> > > > Some Text Some Text Some Text Some Text Some Text
>> > > >                  </p>
>>
>> > > >                </div>
>> > > >              </div>
>>
>> > > >            </div>
>> > > >            <!-- end content -->
>> > > >          </div>
>> > > >          <!-- end container -->
>> > > >        </div>
>> > > >        <div id="footerWrapper">
>> > > >          <div id="footer">
>> > > >            <p style="padding-top:10px">
>>
>> > > >            </p>
>> > > >          </div>
>> > > >        </div>
>> > > >      </div>
>> > > >    </div>
>> > > >  </body>
>> > > > </html>
>>
>> > > > In the above file i am using url('images/css/topBanner.jpg'); where
>> > > > the image is in the "raw->images->css" folder. I am unable to load
>> > > > this file.
>>
>> > > > On Nov 11, 1:34 pm, Miguel Morales <[email protected]> wrote:
>> > > > > That's not detailed at all, very bad explanation.
>> > > > > Again, you'll have to post code, logs, etc.
>>
>> > > > > On Fri, Nov 11, 2011 at 12:28 AM, Sunil Mishra <
>> > [email protected]
>> > > > >wrote:
>>
>> > > > > > Because i want the contents of my phone to be shared, i am able to
>> > do
>> > > > > > that. Only thing i need is to design the html page that i am
>> > sending
>> > > > > > with css. I am unable to use any images in the html page.
>>
>> > > > > > On Nov 11, 12:12 pm, Miguel Morales <[email protected]>
>> > wrote:
>> > > > > > > Why not have the HTTP server on the PC and use the Android
>> > device as
>> > > > a
>> > > > > > > client?
>>
>> > > > > > > You'll probably have to post code, logs, etc to get better help.
>> >  At
>> > > > > > least
>> > > > > > > explain, in much better detail, your issue.
>>
>> > > > > > > On Thu, Nov 10, 2011 at 10:56 PM, Sunil Mishra <
>>
>> ...
>>
>> read more »
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Daniel Drozdzewski

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to