Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7498155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:21:48+00:00 2026-05-29T19:21:48+00:00

public static String ConnDB() throws ParseException, IOException { // TODO Auto-generated method stub String

  • 0
public static String ConnDB() throws ParseException, IOException {
    // TODO Auto-generated method stub
    String webAddress = "http://10.0.0.1:8080/jspbook/AppStore/NewFile.php";
    HttpGet httpGet = new HttpGet(webAddress);
    HttpClient httpclient = new DefaultHttpClient();
    HttpResponse response = httpclient.execute(httpGet); 
    String responseBody = EntityUtils.toString(response.getEntity());                   
    Log.d("res", responseBody);
    return responseBody;
}

Above is part of android code. I checked this code getting resopnse from php server without problem.

However, emulator not only received values from php, but also received all the php code which I dont
need.


$time = “test time”;
$grade = “test grade”;
$title = “test title”;
$content = “test content”;

echo ( “$time ” );
echo ( “$grade ” );
echo ( “$title ” );
echo ( “$content ” );
echo(“abc”);
?>

I only need value of $time , $grade , $title, $content but my emulator gets all the php code.

so.. my question is.. How can I convert php String $time to android java String time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:21:49+00:00Added an answer on May 29, 2026 at 7:21 pm

    It seems that your server doesnt support php well. Instead of giving u plain php text you should get html output.

    BTW: Did u forget the < ? php in your script?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

look at these code: public static String get(String url, Properties parameters) throws MalformedURLException, IOException{
Consider the following sequence of events public static void main(String[] a) throws IOException {
Here's the method: public static String CPUcolor () { System.out.println (What color am I?)
Here is my method: public static string GenerateRandomString(int bytes) { var rng = new
Consider a method in a .NET assembly: public static string GetSecurityContextUserName() { //extract the
public static string ChangeUriToHttps(HttpRequest request) { string uri = request.Url.AbsoluteUri; if (!IsRequestSecure(request)) uri.Replace(http, https);
Given a method public static string[] Foo(System.IO.Stream stream) { XmlTextWriter xmlWriter = new XmlTextWriter(stream,
Assume a method declared as the following: public static string GetString<T>(IEnumerable<T> collection, string theProperty)
I have the following method: public static string UlList(this HtmlHelper helper, List<IEntity> entities, string
I have simple method in C# : public static string BetweenOf(string ActualStr, string StrFirst,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.