[android-developers] Server requires SMB2.0, please unlock

2017-08-31 Thread Keith Sheppard
I have written an Android app that accesses shared folders on Windows PCs 
and on my NAS drive. This has been working fine for some time now.

I've just come back from a short break and something has happened to my 
Windows 10 Laptop with the result that I can no longer connect to it from 
any of my Android devices. After repeated failures, both from my own app 
and a network-aware file manager, I reluctantly resorted to re-installing 
ES File Explorer. In ES, the icon for my laptop now has a little red dot in 
the top left corner. If I click on it, ES File Explorer reports:

unlock SMB2.0
The server that you want to set up requires SMB2.0. Please unlock first.

This is followed by an advert for a game I don't want and an unlock button. 
I've not tried the button in case it installs the game (these ads are the 
main reason I gave up on ES in the first place).

My laptop didn't require SMB2.0 a week ago. Can anyone suggest what might 
have changed in the interim and whether I can reverse that change at the 
laptop end?

What does unlocking SMB2.0 actually mean? I don't just want to be able to 
access the server from ES, I need to be able to access it from my own app. 
If I click the Unlock button in ES will that then enable me to access the 
laptop from all Android apps or do I need to do something to my Android app 
to enable it to access a server that "requires SMB2.0"?

Note that my desktop PC (also Windows 10) and my NAS drive aren't affected 
by this problem. I can still connect to those from my Android app.

Any advice or information gratefully received.



-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/c1519202-07cb-4ded-943c-4405894f50e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Activity closing prematurely

2017-02-27 Thread Keith Sheppard
My main activity kicks off a secondary activity (using 
startActivityForResult) that invites the user to input details of one of 
four players at a bridge table.

When the user has chosen a player and clicked OK, the following things 
happen (triggered by code in onActivityResult)

1. The player details (passed back in the Intent returned by the secondary 
activity) are written to a text file.
2. An AsyncTask is started to send that file to a server PC using SMB.
3. While the AsyncTask is still running, the same secondary activity is 
invoked again to get the next player's details.

This sequence is repeated until all four players' details have been sent to 
the server.

On my tablet, this works perfectly every time but one of my beta testers 
has a bizarre problem. He can usually enter the first player's name 
successfully, sometimes the second and occasionally the third but 
eventually one of the names screens appears for a short time later only to 
disappear again without the user clicking my OK button.

Note that the player-names screen allows the user to type a partial name 
and uses a ListView to display all players in a club membership list that 
contain the letters typed. I don't know if that's significant.

What I am seeing in my trace file is that the onCreate method of the select 
player activity is called. The OKClicked method is never called. In fact, I 
have trace points before every finish() call in the select player activity 
and none of them is called. After the onCreate call, the next thing I see 
in my trace file, about 30 seconds later, is onActivityResult reporting a 
ResultCode of zero and the returned Intent pointer of null. In other words, 
the select player activity has spontaneously closed without the user 
clicking OK or it going through any of my code designed to close the 
activity tidily.

This never happens on my tablet, which is running Android 4.4.2. It always 
happens on my beta tester's tablet, which is running 4.4.

After reading reports of a similar Android problem, I changed all the 
activities' settings in my manifest (including the main activity) to 
launchMode singleTop but this made no difference.

Any suggestions? This is particularly awkward because I cannot reproduce 
the problem on my kit. I am having to do all my debugging remotely by 
adding trace points and asking my beta tester to repeat the experiment.

I have uploaded the code for the select player activity in case it's of 
interest.

Kind regards
Keith


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/6502018f-b8b0-4dbb-a3a8-b132458cca3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
package uk.org.writerman.scoresheet;

import android.content.Intent;
import android.os.SystemClock;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.HashMap;

public class SelectPlayer extends AppCompatActivity {

private cClubMembers MembershipList = new cClubMembers();
private cClubMembers EBUList = new cClubMembers();

private cClubMembers MatchingPlayers = new cClubMembers();

private cClubMemberDetails ChosenPlayer;

private String TableName;
private boolean UseExternalFilestore;
private boolean HaveNamesFile;
private boolean HaveEBUList;
private String SeatName;

private Button OKButton;
private ImageButton SearchButton;

private ListView lvMatches;
private long LastAbortClick;

private boolean m_InternalChange;
private boolean VisitorOnDisplay;

@Override
protected void onCreate(Bundle savedInstanceState) {
// SelectPlayer. Parameters are Table identity string, Seat (as string) UseExternalFilestore and HaveNames
// If it's a repeat, may also have ParamPlayerID, ParamPlayerName and ParamPlayerEBUNo
// Return values are ParamPlayerID, ParamPlayerName and ParamPlayerEBUNo

// We use the prompt above the input box (instructions when input is empty) to show
//  no matches, number of matches or 

[android-developers] Displaying accented letters

2016-11-21 Thread Keith Sheppard
I have a list of people's names that originally came from a database on a 
Windows system. It gets transferred to my Android app in an XML file sent 
over the network.

My problem is that some of the names include accented characters. For 
example, one name contains an o with an acute accent.

I need to be able to display these names, with their accents, in both a 
textView and a Spinner control. In my first version, I did nothing and the 
accented character appeared as a black diamond containing a question mark. 
I then tried converting all accented letters to their HTML escape versions, 
for example replacing the o acute with . I had hoped that this 
would be translated back to the correct accented character at the Android 
end but it wasn't. The string  appeared in my Android app controls.

Is there any simple way I can display a string that potentially includes 
accents in my Android app, with those accents correctly displayed? Note 
that I have control over both the Windows end and the Android end so I can 
modify the format of the XML file sent from Windows to Android if 
necessary. I would rather not have to tinker with fonts if it can be 
avoided.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/0f2ac8b0-0b74-4c3b-958a-30c2735800a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Spinner control displays unwanted keyboard

2016-11-05 Thread Keith Sheppard
 

I have an activity in which there are several buttons and a spinner 
containing a list of preset values. Unfortunately, if the user accidentally 
or mistakenly taps the spinner, the soft keyboard appears. Why? There is 
nowhere on the screen that expects typed input from the user.


More to the point, how can I prevent this from happening? After some 
research, I tried adding the following code:


 m_TricksPicker.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
InputMethodManager imm=(InputMethodManager)getApplicationContext().
getSystemService(getApplicationContext().INPUT_METHOD_SERVICE);


imm.hideSoftInputFromWindow(getParent().getCurrentFocus().getWindowToken(), 0);

return false;
}}) ;

Unfortunately, this throws a null pointer exception. Any other suggestions 
how to stop the keyboard from appearing (and I'd really like to understand 
why the system thinks it's necessary in the first place, when no user input 
is required)?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/e229b1bb-03bc-4ffd-8f2b-09bb86e8610a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android Studio project suddenly, and inexplicably, changed to API 24

2016-07-19 Thread Keith Sheppard
 0 down vote favorite 

 

I have been developing my app for a couple of weeks, routinely rebuilding 
without errors. Then something weird happened to my Windows system. It's as 
if all my Android Studio settings have been lost. Normally, when I start 
Android Studio, it automatically loads my project. Today it didn't and I 
had to open the project manually.


I then tried to open one of my layout XML files and it refused to render it 
saying "Android N requires the IDE to be running with Java 1.8". I 
remembered I had this problem before. I clicked on the little green man 
with a 24 next to him and chose "API 23: Android API 23". Problem solved. I 
can now see my activity layout. Except...


Unfortunately, if I now close Android Studio and re-open it, it forgets 
that I selected API 23 and again says "Android N requires..." and I have to 
explicitly choose API 23 again. Why isn't it remembering like it used to?


However, that's a mere inconvenience compared with the other problem. Now, 
when I try to rebuild my app I get the error "compileSdkVersion 
'Android-24' requires JDK 1.8 or later to compile." It wasn't saying that 
yesterday. What's gone wrong?


How do I convince Android Studio, permanently, that I want to use API 23 
and not 24 for rendering and how do I fix the compilation error?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f7c5a560-7ab8-451b-9aa8-d13f505e6d7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.