Click here to Skip to main content
14,923,204 members
Home / Discussions / Android
   

Android

 
GeneralRe: android widget Pin
Member 135607746-Dec-17 0:58
MemberMember 135607746-Dec-17 0:58 
GeneralRe: android widget Pin
Richard MacCutchan6-Dec-17 1:02
mveRichard MacCutchan6-Dec-17 1:02 
GeneralRe: android widget Pin
Member 135607747-Dec-17 0:46
MemberMember 135607747-Dec-17 0:46 
GeneralRe: android widget Pin
Richard MacCutchan7-Dec-17 0:49
mveRichard MacCutchan7-Dec-17 0:49 
GeneralRe: android widget Pin
Member 135607747-Dec-17 3:18
MemberMember 135607747-Dec-17 3:18 
GeneralRe: android widget Pin
Member 135607748-Dec-17 0:55
MemberMember 135607748-Dec-17 0:55 
QuestionRe: android widget Pin
David Crow6-Dec-17 3:01
MemberDavid Crow6-Dec-17 3:01 
QuestionHow to show pdf file in andorid app Pin
Subrata.In26-Nov-17 17:06
MemberSubrata.In26-Nov-17 17:06 
I try to create a simple android mobile app. Using Eclips, I just use WebView control and target that control to a mobile web form/web page (by using loadUrl) which is asp.net page.

On asp page I try to create a pdf and try to open/download. I successfully create the pdf file. But fail to open that file in separate window (adobe reader) and also I am unable to download that file in device.

Please give some solution to open pdf in separate window (outside mobile app) or download the pdf file from server to local device.

Thanks in advance.

What I have tried:

//On my mobile app I use: 
WebView wv1=(WebView)findViewById(R.id.webView1);
wv1.setWebViewClient(new MyBrowser()); 
String url = "http://example.com/testprint.aspx"; 
wv1.loadUrl(url);

//On testprint.aspx I use: 
<html xmlns="w3.org/1999/xhtml"; > <body> 
<mobile:Form id="Form1" runat="server"> 
<mobile:Command ID="Command1" Runat="server" OnClick="Command1_Click">Command</mobile:Command> 
</mobile:Form> </body> </html>

//On testprint.aspx.cs I use: 
string FilePath = Request.PhysicalApplicationPath + "\\MyPDF\\test.pdf";
//I write a method here to create pdf file 
/*.......*/ 
//After that I write this code for open that file (which I create above)
Response.ContentType = "application/pdf"; 
Response.AppendHeader("Content-Disposition", "attachment; filename=test.pdf"); 
Response.TransmitFile(FilePath); 
Response.End();


//I also try to use below method also to download the file
string FilePath = Request.PhysicalApplicationPath + "\\MyPDF\\test.pdf";
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(_Path));

const int _bufferLength = 10000;
byte[] _buffer = new Byte[_bufferLength];
int _length = 0;
Stream _download = null;
try
{
    _download = new FileStream(_Path, FileMode.Open, FileAccess.Read);
    do
    {
        if (Response.IsClientConnected)
        {
            _length = _download.Read(_buffer, 0, _bufferLength);
            Response.OutputStream.Write(_buffer, 0, _length);
            _buffer = new Byte[_bufferLength];
        }
        else
        {
            _length = -1;
        }
    }
    while (_length > 0);
    Response.Flush();
    Response.End();
}
finally
{
    if (_download != null) _download.Close();
}

GeneralRe: How to show pdf file in andorid app Pin
Richard MacCutchan26-Nov-17 21:40
mveRichard MacCutchan26-Nov-17 21:40 
GeneralRe: How to show pdf file in andorid app Pin
Subrata.In27-Nov-17 0:34
MemberSubrata.In27-Nov-17 0:34 
GeneralRe: How to show pdf file in andorid app Pin
Richard MacCutchan27-Nov-17 1:07
mveRichard MacCutchan27-Nov-17 1:07 
AnswerRe: How to show pdf file in andorid app Pin
Jochen Arndt27-Nov-17 1:19
professionalJochen Arndt27-Nov-17 1:19 
AnswerRe: How to show pdf file in andorid app Pin
FineSoft Technologies14-Dec-17 18:23
MemberFineSoft Technologies14-Dec-17 18:23 
AnswerMessage Closed Pin
7-Jan-18 19:41
MemberbarrontD7-Jan-18 19:41 
Questioni want to build an android app that can take a picture of a voucher or credit numbers and recharge my phone automatic can you help please? Pin
Member 1352904723-Nov-17 12:10
MemberMember 1352904723-Nov-17 12:10 
AnswerRe: i want to build an android app that can take a picture of a voucher or credit numbers and recharge my phone automatic can you help please? Pin
David Crow24-Nov-17 16:55
MemberDavid Crow24-Nov-17 16:55 
QuestionEclipse // Portable ? Pin
C-P-User-316-Nov-17 6:00
MemberC-P-User-316-Nov-17 6:00 
AnswerRe: Eclipse // Portable ? Pin
Richard MacCutchan16-Nov-17 21:55
mveRichard MacCutchan16-Nov-17 21:55 
GeneralRe: Eclipse // Portable ? Pin
C-P-User-319-Nov-17 2:29
MemberC-P-User-319-Nov-17 2:29 
GeneralRe: Eclipse // Portable ? Pin
Richard MacCutchan19-Nov-17 2:45
mveRichard MacCutchan19-Nov-17 2:45 
GeneralRe: Eclipse // Portable ? Pin
C-P-User-319-Nov-17 2:59
MemberC-P-User-319-Nov-17 2:59 
QuestionRe: Eclipse // Portable ? Pin
David Crow20-Nov-17 4:21
MemberDavid Crow20-Nov-17 4:21 
QuestionWhat is the best way to make an Android app (for a beginner programmer)? Pin
Chessologist7-Nov-17 12:03
MemberChessologist7-Nov-17 12:03 
AnswerRe: What is the best way to make an Android app (for a beginner programmer)? Pin
David Crow9-Nov-17 4:12
MemberDavid Crow9-Nov-17 4:12 
AnswerRe: What is the best way to make an Android app (for a beginner programmer)? Pin
Richard MacCutchan9-Nov-17 4:32
mveRichard MacCutchan9-Nov-17 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.