Click here to Skip to main content
15,892,059 members
Home / Discussions / Android
   

Android

 
AnswerRe: android Pin
Member 1052365028-May-15 6:31
Member 1052365028-May-15 6:31 
AnswerRe: android Pin
Dadecki17-Jun-15 22:54
Dadecki17-Jun-15 22:54 
Questionhow to point in google map using address..? Pin
Member 1172141526-May-15 18:57
Member 1172141526-May-15 18:57 
QuestionRe: how to point in google map using address..? Pin
Richard MacCutchan26-May-15 22:00
mveRichard MacCutchan26-May-15 22:00 
AnswerRe: how to point in google map using address..? Pin
David Crow27-May-15 2:55
David Crow27-May-15 2:55 
QuestionProblem with java and Android Pin
Member 1172109726-May-15 14:59
Member 1172109726-May-15 14:59 
SuggestionRe: Problem with java and Android Pin
Richard MacCutchan26-May-15 21:58
mveRichard MacCutchan26-May-15 21:58 
GeneralRe: Problem with java and Android Pin
Member 1172109727-May-15 15:56
Member 1172109727-May-15 15:56 
K, here is the android code:
ArrayList<string> = new ArrayList<>();
String item = inputText.getText().toString();
ll.add(item);
HashSet<string> set = new HashSet<>(ll);
for (String temp : set)
{answerText.setText(temp + "shows that many times : " + Collections.frequency(ll, temp));
//the output as follows:
33 44 33 44 shows that many times: 1
Basically not finding any duplicates.
However, if I disable the userinput textbox and replace it with manual input like so:
ll.add("33");
ll.add("44");
ll.add("33");
ll.add("44");
ll.add("24");
ll.add("24");
the output will be this: 44 shows that many times: 2
Well, that's finding duplicates. But only for one number. Why? Why not putting out all duplicate numbers? Like it does in Java as a pure Java code without android involved?
That code is this:
List<string> list = new ArrayList<string>();
Scanner stdin = new Scanner(System.in);
System.out.println("Enter the amount of numbers you want to input: Input numbers separated
by a space.");
int n = stdin.nextInt();
for (int i = 0; i < n; i++)
{
list.add(stdin.next());
}
System.out.println("\nCount all with frequency");
Set<string> uniqueSet = new HashSet<string>(list);
for (String temp : uniqueSet) {
System.out.println(temp + " shows that many times : " + Collections.frequency(list, temp));
//Enter the amount of numbers you want to input
12 //hit the return key
22 33 44 22 33 44 22 33 44 22 33 44
//the output is like so:
Count all with frequency
33 shows that many times: 4
44 shows tham many times: 4
22 shows that many times: 4
That's how I want it in android as well. With userinput via textbox if possible. Unfortunately the scanner input is not working in android.
Please can you help me?
Thanks
GeneralRe: Problem with java and Android Pin
David Crow28-May-15 4:20
David Crow28-May-15 4:20 
QuestionHow can I export my Database Information in a file Pin
Jamil.Chowdhury24-May-15 6:46
Jamil.Chowdhury24-May-15 6:46 
QuestionRe: How can I export my Database Information in a file Pin
David Crow26-May-15 7:25
David Crow26-May-15 7:25 
QuestionWhat's the real meaning of a widget? Pin
CRobert45623-May-15 9:46
CRobert45623-May-15 9:46 
AnswerRe: What's the real meaning of a widget? Pin
David Crow23-May-15 12:33
David Crow23-May-15 12:33 
AnswerRe: What's the real meaning of a widget? Pin
Dadecki17-Jun-15 22:56
Dadecki17-Jun-15 22:56 
QuestionUsing a certificate in an android app Pin
Member 1168395012-May-15 8:48
Member 1168395012-May-15 8:48 
QuestionRe: Using a certificate in an android app Pin
David Crow19-May-15 2:32
David Crow19-May-15 2:32 
AnswerRe: Using a certificate in an android app Pin
Member 1168395019-May-15 5:55
Member 1168395019-May-15 5:55 
AnswerRe: Using a certificate in an android app Pin
Member 116839506-Jun-15 7:02
Member 116839506-Jun-15 7:02 
QuestionRegarding Android.. Pin
Member 116768678-May-15 23:21
Member 116768678-May-15 23:21 
SuggestionRe: Regarding Android.. Pin
Richard MacCutchan9-May-15 0:23
mveRichard MacCutchan9-May-15 0:23 
AnswerRe: Regarding Android.. Pin
Dadecki13-May-15 2:57
Dadecki13-May-15 2:57 
Questionhow do we provide security for web app connecting to server Pin
Member 116738607-May-15 19:39
Member 116738607-May-15 19:39 
AnswerRe: how do we provide security for web app connecting to server Pin
Richard MacCutchan7-May-15 21:25
mveRichard MacCutchan7-May-15 21:25 
QuestionRaw cannot be resolved in Eclipse Juno Pin
Member 116612166-May-15 13:09
Member 116612166-May-15 13:09 
AnswerRe: Raw cannot be resolved in Eclipse Juno Pin
Richard MacCutchan6-May-15 21:17
mveRichard MacCutchan6-May-15 21:17 

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.