am relatively new here so please bare with me,
(min sdk target is 25 buildsdk is 29)
This is my connection method that I used in my app and tested on emulator which worked and fetched the data correctly in the if block on emulator pixel 4A ,
try {
Class.forName("net.sourceforge.jtds.jdbc.Driver");
ConnURL = getResources().getString(R.string.url);
conn = DriverManager.getConnection(ConnURL);
} catch (SQLException se) {
Log.e("ERROR", se.getMessage());
error.setText("SQLException");
err_flag=false;
} catch (ClassNotFoundException e) {
Log.e("ERROR", e.getMessage());
error.setText("ClassNotFoundException");
err_flag=false;
} catch (Exception e) {
Log.e("ERROR", e.getMessage());
error.setText("Exception");
err_flag=false;
}
if(conn!=null)
{
/
/
}
else
{
progressBar.setVisibility(View.GONE);
//error.setText("Conn is NULL");
Toast.makeText(getContext(),"Error Encountered, Try Again",Toast.LENGTH_LONG).show();
}
My Connect URL is as following:
jdbc:jtds:sqlserver://moons.database.windows.net:1433;DatabaseName=****;user=****;password=****;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;ssl=request
Firewall Settings of Azure Server
When I tested the app on my Huawei Y9 prime Android 10 (real device) (works fine on android studio emulator api 31 Pixel 4A), I am getting this error in the log Cat and the connection is returned Null
Log Cat Error:
This exception is thrown by first Catch block (SQLException se)
E/ERROR: Network error IOException: SSL handshake aborted: ssl=0x738d986cc8: I/O error during system call, Broken pipe.
Complete Log Cat:
09/05 20:01:37: Launching 'app' on HUAWEI STK-L21.
Install successfully finished in 2 s 676 ms.
$ adb shell am start -n "com.example.fyp/com.example.fyp.Splash" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 28785 on device 'huawei-stk_l21-TMFNW19926007079'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/com.example.fy: QarthPatchMonintor::Init
QarthPatchMonintor::StartWatch
QarthPatchMonintor::WatchPackage: /data/hotpatch/fwkhotpatch/
QarthPatchMonintor::CheckAndWatchPatch: /data/hotpatch/fwkhotpatch/com.example.fyp
QarthPatchMonintor::CheckAndWatchPatch: /data/hotpatch/fwkhotpatch/all
QarthPatchMonintor::Run
I/com.example.fy: QarthPatchMonintor::Reading
QarthPatchMonintor::CheckNotifyEvent
QarthPatchMonintor::CheckNotifyEvent before read
I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.fyp#10185#256
I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.fyp#10185#0
I/AwareBitmapCacher: init processName:com.example.fyp pid=28785 uid=10185
I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@ed05212
I/FirebaseInitProvider: FirebaseApp initialization successful
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to fallback implementation
V/ActivityThread: callActivityOnCreate
V/HwWidgetFactory: : successes to get AllImpl object and return....
W/com.example.fy: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/com.example.fy: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
D/ActivityThread: add activity client record, r= ActivityRecord{4f702be token=android.os.BinderProxy@35d7d5e {com.example.fyp/com.example.fyp.Splash}} token= android.os.BinderProxy@35d7d5e
D/HiTouch_PressGestureDetector: onAttached, package=com.example.fyp, windowType=1, mHiTouchRestricted=false
I/iGraphics: [0020080c] pn: com.example.fyp, p: 28785
[0030080c] no spt app: com.example.fyp
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
W/Gralloc3: mapper 3.x is not supported
E/: APS:IFLoad:importExternalFunctions, search function createNewHwApsUtils failed, dlsym err:undefined symbol: createNewHwApsUtils
D/: APS:importExternalFunctions OK
I/HwViewRootImpl: removeInvalidNode jank list is null
D/HwFrameworkSecurityPartsFactory: HwFrameworkSecurityPartsFactory in.
I/HwFrameworkSecurityPartsFactory: add HwFrameworkSecurityPartsFactory to memory.
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@6d9bc7a
V/ActivityThread: callActivityOnCreate
D/ActivityThread: add activity client record, r= ActivityRecord{cb8ffa8 token=android.os.BinderProxy@6d9bc7a {com.example.fyp/com.example.fyp.login}} token= android.os.BinderProxy@6d9bc7a
D/HiTouch_PressGestureDetector: onAttached, package=com.example.fyp, windowType=1, mHiTouchRestricted=false
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
I/HwViewRootImpl: removeInvalidNode all the node in jank list is out of time
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@92f9933
V/ActivityThread: callActivityOnCreate
I/OverScrollerOptimization: start init SmartSlideOverScroller and get the overscroller config
get the overscroller config
D/HwGalleryCacheManagerImpl: mIsEffect:false
D/ActivityThread: add activity client record, r= ActivityRecord{1161bf1 token=android.os.BinderProxy@92f9933 {com.example.fyp/com.example.fyp.MainActivity}} token= android.os.BinderProxy@92f9933
D/HiTouch_PressGestureDetector: onAttached, package=com.example.fyp, windowType=1, mHiTouchRestricted=false
W/com.example.fy: Accessing hidden method Landroid/view/View;->getViewRootImpl()Landroid/view/ViewRootImpl; (greylist, reflection, allowed)
Accessing hidden field Landroid/view/View$AttachInfo;->mVisibleInsets:Landroid/graphics/Rect; (greylist, reflection, allowed)
Accessing hidden field Landroid/view/ViewRootImpl;->mAttachInfo:Landroid/view/View$AttachInfo; (greylist, reflection, allowed)
E/1st:ERROR: Network error IOException: SSL handshake aborted: ssl=0x73905b3648: I/O error during system call, Broken pipe
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
I/OpenGLRenderer: Davey! duration=1434ms; Flags=1, IntendedVsync=33031788804864, Vsync=33032172138182, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=33032185699125, AnimationStart=33032185749125, PerformTraversalsStart=33032185986104, DrawStart=33033136778292, SyncQueued=33033148383500, SyncStart=33033149005896, IssueDrawCommandsStart=33033149223604, SwapBuffers=33033219219958, FrameCompleted=33033223873604, DequeueBufferDuration=229000, QueueBufferDuration=1636000,
I/Choreographer: Skipped 61 frames! The application may be doing too much work on its main thread.
I/HwViewRootImpl: removeInvalidNode jank list is null
D/AwareBitmapCacher: handleInit switch not opened pid=28785
I/OpenGLRenderer: Davey! duration=1104ms; Flags=1, IntendedVsync=33032204365039, Vsync=33033221031665, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=33033227853292, AnimationStart=33033228129333, PerformTraversalsStart=33033231209542, DrawStart=33033286090271, SyncQueued=33033293707979, SyncStart=33033294293917, IssueDrawCommandsStart=33033294511104, SwapBuffers=33033303533500, FrameCompleted=33033309802771, DequeueBufferDuration=141000, QueueBufferDuration=3064000,
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
W/libEGL: EGLNativeWindowType 0x73adb07e10 disconnect failed
W/libEGL: EGLNativeWindowType 0x74188f1a90 disconnect failed
D/ActivityThread: Remove activity client record, r= ActivityRecord{4f702be token=android.os.BinderProxy@35d7d5e {com.example.fyp/com.example.fyp.Splash}} token= android.os.BinderProxy@35d7d5e
W/libEGL: EGLNativeWindowType 0x738f9f5510 disconnect failed
W/Settings: Setting device_provisioned has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
V/HiTouch_HiTouchSensor: User setup is finished.
D/HwAutofillHelper: recordCurrentInfo:0
D/HwAutofillHelper: inputType = 65537
I/HwViewRootImpl: removeInvalidNode all the node in jank list is out of time
E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
I/chatty: uid=10185(com.example.fyp) identical 2 lines
E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
V/AudioManager: querySoundEffectsEnabled...
E/ERROR: Network error IOException: SSL handshake aborted: ssl=0x738f845048: I/O error during system call, Broken pipe
I/HwViewRootImpl: removeInvalidNode jank list is null
Sorry If am missing anything, I'll add more info if needed by any user. Thank you for understanding.