Run it in another thread using the Threading library.
B4X:
Sub AppStart(....)
Dim thr As Thread
thr.Initialise("thr")
thr.Start(Me,"CheckForFile",Array(Dir,""))
Wait For File_Result(Result As Boolean)
Log("Does it exist? " & Result)
End Sub
Sub CheckForFile(dirObj As Object, fnObj As Object)
Dim dir As String = dirObj
Dim fn As String = fnObj
Dim exists As Boolean = File.Exists(dir,fn)
CallSubDelayed2(Me, "File_Result", exists)
End Sub
The next versions of B4J, B4A and B4i will include several async methods including ListFilesAsync which can be used as an alternative to File.Exists and it will not block the main thread.