Android

The Android platform is a software stack for mobile devices including an operating system, middleware and key applications. Developers can create applications for the platform using the Android SDK. Applications are written using the Java programming language and run on Dalvik, a custom virtual machine designed for embedded use which runs on top of a Linux kernel.

If you want to know how to develop applications for Android, you can visit the google android page...

4 comments:

vikas said...

132468

vikas said...

thanks dear.
u have good idea for upload a file on server.
if any help or want to share anything u can share with me.
byeeeeeeeeeee.

mohhammad ghouse said...

I had tried it but i did't get idea is we are posting a uploaded image into perticular i had tried but it is not working could u help me to solve the problem



public JsonResult UploadFiles()
{


var imageModels = new List();
string savedFileName = "";
foreach (string file in Request.Files)
{
HttpPostedFileBase hpf = Request.Files[file] as HttpPostedFileBase;
var files = hpf;
if (hpf.ContentLength == 0)
continue;
string ext = Path.GetExtension(hpf.FileName);
string strRealname = Path.GetFileName(hpf.FileName);
if (ImageExtensions.Contains(ext.ToUpperInvariant()))
{
savedFileName = Path.Combine(Server.MapPath("~/Content/Images"), Path.GetFileName(hpf.FileName));

hpf.SaveAs(savedFileName);

imageModels.Add(new Images { ImageURL = hpf.FileName.Replace(" ", "%20") });

HttpWebRequest request;
request = (HttpWebRequest)HttpWebRequest.Create("http://www.landmarkit.in/sellerscommerce/CMS/WidgetImages/" + strRealname);
request.KeepAlive = true;
request.Method = "POST";


byte[] byteArray = ConvertImageToByteArray((System.Drawing.Image)new Bitmap(savedFileName), ImageFormat.Jpeg);
request.ContentType = "image/JPEG";
request.ContentLength = byteArray.Length;
Stream newStream = request.GetRequestStream();
newStream.Write(byteArray, 0, byteArray.Length);
newStream.Close();

}
else
{
return Json(new { name = "", extension = hpf.FileName });
}
}
ViewData["ImagePath"] = imageModels[0].ImageURL;
return Json(new { name = imageModels[0].ImageURL });
}


private static byte[] ConvertImageToByteArray(System.Drawing.Image imageToConvert, ImageFormat formatOfImage)
{
byte[] Ret;
try
{

using (MemoryStream ms = new MemoryStream())
{
imageToConvert.Save(ms, formatOfImage);
Ret = ms.ToArray();
}
}
catch (Exception) { throw; }

return Ret;
}

mohhammad ghouse said...

but my images r not posting in to the given url plz check it once thanks in advance