|
Well done bro !!
It's out of use now !! THANK YOU !!
|
|
|
|
|
|
Why bytecode cannot be run in Android?
|
|
|
|
|
|
its related to android application if you know about this please reply
Thank you
|
|
|
|
|
That does not mean anything either.
|
|
|
|
|
Taking the relevant words from your posting this was the results.
bytecode android - Google Search[^]
Learn to do some basic research!
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Because something is wrong with it.
"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
|
|
|
|
|
how can i show a progress Bar when downloading using download manager and broadcast receiver
|
|
|
|
|
See here and/or 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
|
|
|
|
|
I am trying to move a checked listview item from one activity to a textview of another activity. But the problem is no matter which item I click, I am only getting textview value of first item(Position) in listview.
Listview code
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
SparseBooleanArray checked =listView.getCheckedItemPositions();
ArrayList<String> selectedItems = new ArrayList<String>();
String str = null;
for (int i = 0; i < checked.size(); i++) {
int position;
position = checked.keyAt(i);
if (checked.valueAt(i))
selectedItems.add(String.valueOf(arrayAdapter.getItem(position)));
str = listView.getItemAtPosition(i).toString();
str=str.replaceAll("[^\\d.]", "");
}
Intent i = new Intent(getApplicationContext(), Activation.class);
i.putExtra("contact", str);
startActivity(i);
arrayAdapter.remove(str);
}
});
This is the code of how the listview item is accepted as textview
Intent i = getIntent();
String product = i.getStringExtra("contact");
text.setText(product);
|
|
|
|
|
You are setting the value of str to a new string each time round the loop. So when the loop terminates it will contain the text from the last item in the list.
|
|
|
|
|
Yea, I tried setting the str value outside the loop, but the result's the same.
|
|
|
|
|
You need to do it where you test for a selected item in the ListView.
|
|
|
|
|
Is this a single- or multi- selection listview?
Member 14079444 wrote: if (checked.valueAt(i)) If this evaluates to true, shouldn't you exit the for loop, or are you continuing the search for some other reason?
"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
|
|
|
|
|
How to send data from android app to a php page?
|
|
|
|
|
Wouldn't it be by using either an HTTP POST or GET command?
"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
|
|
|
|
|
It is very important for a mobile application too talk to web based applications. There are various scenarios where we need to fetch data from web pages .
The code below will enable your android app to talk to a webpage.
Note : You also need to enable uses permission for internet in the android.manifest file.
<uses-permission
android:name="android.permission.INTERNET" />
Code for android app
public void postData(String toPost) {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.URL.com/yourpage.php");
String MyName = 'adil';
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
nameValuePairs.add(new BasicNameValuePair("action", MyName));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String response = httpclient.execute(httppost, responseHandler);
String reverseString = response;
Toast.makeText(this, "response" + reverseString, Toast.LENGTH_LONG).show();
} catch (ClientProtocolException e) {
Toast.makeText(this, "CPE response " + e.toString(), Toast.LENGTH_LONG).show();
} catch (IOException e) {
Toast.makeText(this, "IOE response " + e.toString(), Toast.LENGTH_LONG).show();
}
}
php code
<?php
$reversed = strrev($_POST["action"]);
echo $reversed;
?>
modified 29-Dec-18 2:08am.
|
|
|
|
|
Android – sending and receiving data from a php page
29
JAN
It is very important for a mobile application to talk to web based applications. There are various scenarios where we need to fetch data from web pages .
The code below will enable your android app to talk to a webpage.
Note : You also need to enable uses permission for internet in the android.manifest file.
<uses-permission
android:name="android.permission.INTERNET" />
Code for android app
public void postData(String toPost) {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.URL.com/yourpage.php");
String MyName = 'adil';
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
nameValuePairs.add(new BasicNameValuePair("action", MyName));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String response = httpclient.execute(httppost, responseHandler);
String reverseString = response;
Toast.makeText(this, "response" + reverseString, Toast.LENGTH_LONG).show();
} catch (ClientProtocolException e) {
Toast.makeText(this, "CPE response " + e.toString(), Toast.LENGTH_LONG).show();
} catch (IOException e) {
Toast.makeText(this, "IOE response " + e.toString(), Toast.LENGTH_LONG).show();
}
}
php code
<?php
$reversed = strrev($_POST["action"]);
echo $reversed;
?>
|
|
|
|
|
I'm working on an Android app that we only want to allow to run if the user has VPN'd into the network.
The question is, how do I determine if the user has VPN'd in?
I have tried the following:
var address = Dns.GetHostAddresses("www.mycompany.com").FirstOrDefault();
var hostName = Dns.GetHostName();
var domainName = System.Environment.UserDomainName;
UserDialogs.Instance.Alert(domainName, "Domain Name", "OK");
UserDialogs.Instance.Alert(hostName, "Host Name", "OK");
UserDialogs.Instance.Alert(address.ToString(), "Address", "OK");
The results are always the same, even if I'm NOT VPN'd in.
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
|
So what are you saying, that there's no way to determine if I'm VPN'd in?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
I don't know for sure, but none of the properties you referred to will tell you. They are all related to the real network that you finally connect to. Information about the VPN would be external to them. Probably more important to explain what problem you are actually trying to solve.
|
|
|
|
|
Richard MacCutchan wrote: Probably more important to explain what problem you are actually trying to solve.
I did in my post
"I'm working on an Android app that we only want to allow to run if the user has VPN'd into the network."
The app generates a daily barcode for logging into an instrument we have. We only want internal users to run the app.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Just to clarify, this is for Android devices connected to your internal network via VPN, and not WiFi?
Are you using a VPN app on the Android device?
Could the barcode that the Android device is generating be uploaded to a secure web site? I'm not trying to change your mind, rather just trying to see if there are any other ways to skin that cat.
"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
|
|
|
|