|
Johnny Bayne wrote: I had some problems with it - in the script I have errors but I don`t know what I need to do to fix them. I had read a lot of information about it but I so far don`t understand what I need to do. Maybe somebody can help? Or at least give advise where I can read about it. Try here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi, here is my code:
package com.example.work.try1;
import android.widget.Button;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.EditText;
import android.net.Uri;
import android.content.Intent;
import android.view.View;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class Launch extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_launch);
final View buttonS = findViewById(R.id.button);
buttonS.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Uri uri = Uri.parse("https://www.navanithiastrolife.com");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
Button b = (Button) findViewById(R.id.button2);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText e1 = (EditText) findViewById(R.id.editText);
String username = e1.getText().toString();
EditText e2 = (EditText) findViewById(R.id.editText3);
String password = e2.getText().toString();
OutputStream out = null;
try {
URL url = new URL("http://iconinfo.tech/mob_app/");
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.connect();
urlConnection.setRequestMethod("POST");
urlConnection.setRequestProperty("username",username);
urlConnection.setRequestProperty("password",password);
urlConnection.setDoOutput(true);
urlConnection.disconnect();
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
});
}
}
|
|
|
|
|
Member 13449286 wrote: Hi, here is my code: And where is your question?
|
|
|
|
|
In my topic. "How to write POST method to PHP."
|
|
|
|
|
|
POST server request to PHP server from Android java program. Post means you send a request to server and get response, like a password username login.
|
|
|
|
|
Sorry, but I have no idea what you are talking about. Please edit your original post and explain in proper detail what your problem is.
|
|
|
|
|
Member 13449286 wrote: Hi, here is my code: And what is it doing (besides not working)?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Good Day Everyone
I have a Code that saves data and send an email after that. want to show Progress Dialog when this is happening. This code is in a Fragment that is shown in a Tab. below is my code
in my Activity this works nicely. i have a challenge in making this to work in a Fragment
btn_contact_save.Click += (sender, e) =>
{
var progressDialog = new ProgressDialog(Context);
progressDialog.SetTitle("Saving...");
progressDialog.Indeterminate = true;
progressDialog.Show();
progressDialog.SetCancelable(false);
<pre>
btn_details_save_Click(view);
progressDialog.Dismiss();
};</pre>
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
Vimalsoft(Pty) Ltd wrote: i have a challenge in making this to work in a Fragment And that challenge would be what exactly?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
The Dialog does not show
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
Where is the context coming from? Is an exception being thrown?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
hi
There is no Exception , the Context is the Application Context (Context.Android.Support.V4.App.Fragment.Context) , i also tried to declare the context at a fragment level and initialize it on OnCreateView (Android.Content.Context) but still it does not show the dialog.
Please note this dialog shows nicely in an Activity not a Fragment.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
Vimalsoft(Pty) Ltd wrote:
There is no Exception... You know this, even without a try/catch block?
Vimalsoft(Pty) Ltd wrote: , the Context is the Application Context (Context.Android.Support.V4.App.Fragment.Context) , i also tried to declare the context at a fragment level and initialize it on OnCreateView (Android.Content.Context) but still it does not show the dialog. Have you tried using getActivity() when constructing the ProgressDialog ?
Vimalsoft(Pty) Ltd wrote:
Please note this dialog shows nicely in an Activity not a Fragment. Which means nothing. While a fragment runs within an activity, that does not mean they are interchangeable.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
You know this, even without a try/catch block?
<b>i stepped through and no exception was raised.</b>
Have you tried using getActivity() when constructing the ProgressDialog?
let me try that and i will get back to you.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
I created a small app based on a "Tabbed Activity." It has two tabs. The content of both tabs will be a ListView filled from the Contacts database. Because of the new Permissions requirements that came out with Android 6, I need permission from the user at runtime to access that datastore. As such, I am calling checkSelfPermission() and requestPermissions() as prescribed in the docs.
If I put those calls in the activity, I get one request dialog asking for permission, and because requestPermissions() runs synchronously in a separate thread, the two fragments are allowed to finish their creation in the main thread. Once permission is granted, the activity sends both fragments a message indicating they can now populate their ListView s. This works fine, until I restart the app. Since permission has now been granted, requestPermissions() does not run, and the message that the activity sends to the fragments gets there before the fragments have been fully created. Just to see what would happen, I preceded the message with a 1-second sleep and that gave the fragments enough time to finish their creation. This works fine for both a first-time and restarted app. I did not like this approach because of the delay, so I kept looking.
If I put those calls in each fragment, I get two requests asking for permission. I can grant permission to neither, one or the other, or both, and the fragments will respond accordingly. The obvious problem is the two request dialogs. I could not find the proper way of having one fragment communicate to the other that it has already sought permission and that a second request is not necessary.
Another thing I tried was to put a call to checkSelfPermission() in each fragment's onActivityCreated() method to continuously poll the desired permission. The call to requestPermission() was still done once in the activity. Once the permission was granted, each fragment would then go about populating its ListView . This worked, but it still felt wrong given the pausing and polling each fragment was having to do.
I feel my first approach is the proper way to go, but cannot find a suitable solution to the timing issue. I found out a long time ago when doing Windows development that inserting code to slow down or speed up your program's execution is a major recipe for disaster. Better to signal events instead. So far I'm unable to find a comparable solution in either Java or Android.
Any helpful suggestions?
Thanks.
- DC
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
modified 29-Sep-17 15:37pm.
|
|
|
|
|
Good Day Everyone
From my AppCompatActivity class i am trying to open an activity as an intent like this
<pre>Intent homemap = new Intent(this, typeof(HomeMap));
var fintent = new Intent(this, homemap.Class);
StartActivity(fintent);</pre>
and my manifest i have declared my Activity like this
<pre><activity
android:name=".Toletsa.HomeMap"
android:label="@string/title_activity_maps" /></pre>
and my package name in the manifest is package="com.vimalsoft.toletsa" . My assembly name is Toletsa and my namespace is Toletsa
The layout file for my Activity that i want to open as an intent is
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_privacy_policy"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.vimalsoft.toletsa.Toletsa.HomeMap">
<fragment
android:id="@+id/map"
android:layout_width="200dp"
android:layout_height="200dp"
class="com.google.android.gms.maps.MapFragment" />
</RelativeLayout>
when i run the project i get an error when starting the activity
Unhandled Exception:
Android.Content.ActivityNotFoundException: Unable to find explicit activity class {com.vimalsoft.toletsa/android.content.Intent}; have you declared this activity in your AndroidManifest.xml?
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
I'm not certain about this but I have something similar, but does it this way:
Intent homemap = new Intent(this, HomeMap.class);
|
|
|
|
|
Good Day
i was able to resolve the issue i just changed this
android:name=".Toletsa.HomeMap"
in my Manifest to
android:name=".HomeMap"
and this solved my problem , the code was ok
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
technology stack for Android chat application. Anyone explain it clearly.
|
|
|
|
|
Type "Android chat" into Google and you will find all the information you need.
|
|
|
|
|
Before to start building a chat app you need to focus on both Client and Server separately. Technology stack behind the Android chat application are
Server : Ejabberd
Language : Erlang
Protocol : XMPP
Database management : Mnesia & Mysql
Multimedia files storage : YAWS
Operating system : FreeBSD
|
|
|
|
|
I have to connect sql srver from my laptop in android application, what i do???
java.sql.SQLException: Unknown server host name 'Unable to resolve host'
getting above problem.
Tell me steps, hoe to connect to sql server.
|
|
|
|
|
The error message is quite clear, your host name either does not exist or cannot be reached from the client system.
|
|
|
|
|
Let us see the code you have done so far , so we correct it
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|