Adeel Zafar
48d9978f6a
Resolve lint warnings in WebServerHelper.java
2019-07-31 23:39:03 +05:00
Adeel Zafar
eefeaed069
Add delay before start server dialog for devices < O
2019-07-31 23:39:02 +05:00
Adeel Zafar
2e0da70bf4
Resolve hotspot details dialog bug
2019-07-31 23:39:02 +05:00
Adeel Zafar
e784200649
Start service from mobile data dialog response
2019-07-31 23:39:01 +05:00
Adeel Zafar
5d08156b1e
Refactor code in WebServerHelper
...
Remove unnecessary code.
2019-07-31 23:39:00 +05:00
Adeel Zafar
ffed7c2e64
Stop webserver when hotspot is stopped
2019-07-31 23:39:00 +05:00
Adeel Zafar
ba4230f17c
Start webserver for devices >=Oreo
2019-07-31 23:38:59 +05:00
Adeel Zafar
f7d063b7e0
Remove network change broadcast receiver
...
Because no intent filter available/working for wifi hotspot ap.
2019-07-31 23:38:59 +05:00
Adeel Zafar
5d15bed4d2
Clean and Reformat code in WebServerHelper and HotspotService
2019-07-31 23:38:58 +05:00
Adeel Zafar
45d876b656
Add WebServerHelper class
...
Shift server related methods from MainActivity to here.
Call methods of this class from HotspotService dealing with server.
2019-07-31 23:38:58 +05:00
Adeel Zafar
ee7f5c1ff4
Start server from MainActivity
...
Getting ip address
Adding a custom dialog
Adding a network change listener broadcast receiver
Stop android server
Unregister receiver in onDestroy
2019-07-31 23:38:57 +05:00
Adeel Zafar
000da0cc5a
Add WebServer class
...
Add serve method
2019-07-31 23:38:57 +05:00
Adeel Zafar
2f2130a21f
Add NanoHTTPD dependency
2019-07-31 23:38:56 +05:00
Adeel Zafar
956098c3d3
Changed wifi hotspot menu button's visibility modes
2019-07-31 23:38:56 +05:00
Adeel Zafar
76b4a3587f
Resolve lint errors
...
Resolve java warnings
2019-07-31 23:38:56 +05:00
Adeel Zafar
51b5a4f8df
Reverting hotspot preference category
2019-07-31 23:38:55 +05:00
Adeel Zafar
16a6a9f0b6
Add FOREGROUND_SERVICE permission in manifest
...
Device with versions >= Pie need this permission to start foreground service.
2019-07-31 23:38:55 +05:00
Adeel Zafar
16e310793d
WRITE_Settings permission not given bug
...
Handle if write settings permission is not given.
2019-07-31 23:38:54 +05:00
Adeel Zafar
5a8cbb2efc
Add credits to HotspotService
2019-07-31 23:38:54 +05:00
Adeel Zafar
2053e68926
Clean Code
...
Removing unused imports.
Removing irrelevant comments and logs
2019-07-31 23:38:53 +05:00
Adeel Zafar
35ed0e079d
Add dialog showing hotspot details for versions <O
2019-07-31 23:38:53 +05:00
Adeel Zafar
ecf134a632
Fixed local hotspot not stopping bug on devices >=O
...
Now checking hotspotstate from within hotspot service
using the context from main activity.
2019-07-31 23:38:52 +05:00
Adeel Zafar
1f5a52484f
Use startService() for Oreo+
2019-07-31 23:38:50 +05:00
Adeel Zafar
7603f8d5e9
Removing null from hotspot reservation
2019-07-31 23:38:50 +05:00
Adeel Zafar
78bf84e151
Add hotspot preference category.
...
change hotspot ssid and hotspot pass.
2019-07-31 23:38:49 +05:00
Adeel Zafar
51907ffd8c
Add logging to debug
2019-07-31 23:38:49 +05:00
Adeel Zafar
c75296b2de
Add notification channel for devices>=O
...
Added forground hotspot service for >=O
Add constants.
2019-07-31 23:38:48 +05:00
Adeel Zafar
dd76a41bf2
Hotspot foreground service.
...
Added HotspotService
Build foreground notification.
Added broadcast receiver for stop button.
Changed code in MainActivity for API<26.
Added string values
Declared service in manifest.
2019-07-31 23:38:48 +05:00
Adeel Zafar
e4e333ae21
Remove WRITE_SETTINGS permission for devices>=O
2019-07-31 23:38:47 +05:00
Adeel Zafar
7fb1aa8fad
Fixes#1190 and #1189
2019-07-31 23:38:46 +05:00
Adeel Zafar
8a84f38522
Fixes#1188 Add alert dialogs for hotspot details & data warning
...
mobileDataDialog(): tells the user his data is enabled.
hotspotDetailsDialog(): tells the user details of local hotspot.
2019-07-31 23:38:46 +05:00
Adeel Zafar
4964da7869
Add turn on wifi hotspot on a single click feature
...
Added a method toggleHotspot() that deals with recursion.
Now on first app installation, on a single click
permission is asked and if granted, wifi hotspot turns on.
2019-07-31 23:38:45 +05:00
Adeel Zafar
acb53fa5aa
Add documentation and clean code.
...
Add comments to mobile data methods, menu item wifi_hospot
2019-07-31 23:38:44 +05:00
Adeel Zafar
145b177616
Add case in onActivityResult for LocationSettings
...
Checking the result of LocationSettings resolution in onActivityResult
2019-07-31 23:38:44 +05:00
Adeel Zafar
5f5f6709fb
Integrate turn off hotspot feature with UI for devices>=O
...
Added method checkHotspotState()
It checks the state of the hostpot for devices>=Oreo
2019-07-31 23:38:43 +05:00
Adeel Zafar
7807927562
Fixed write permission force settings bug
...
Removed the force variable that forced permission.
Permission will only appear if it is not allowed.
2019-07-31 23:38:42 +05:00
Adeel Zafar
38af60109a
Fixes#1186 Allow user to disable data before turning on hotspot
...
Added a method isMobileDataEnabled() that uses ConnectivityManager
And checks if data is enabled or not.
If data is enabled, then it takes the user to enableDisableMobileData()
It shows the user Data Usage Summary settings screen.
2019-07-31 23:38:41 +05:00
Adeel Zafar
950ca069d5
Fixes#1187 Wifi-hotspot not working with devices>=Oreo fixed.
...
Created a location request
added onCompletionListener for LocationSettingsResponse
Checked LocationSettingsStates in onActivityResult()
Added gms location dependency.
2019-07-31 23:38:40 +05:00
Adeel Zafar
8349f6d380
Add location permissions
2019-07-31 23:38:39 +05:00
Adeel Zafar
d04839f6ef
Workaround for Android versions >=Oreo
...
Worked with WifiManager's startLocalOnlyHotspotCallback
It is specifically for android versions>=O
2019-07-31 23:38:39 +05:00
Adeel Zafar
c8e975f8ed
Add documentation to the code.
2019-07-31 23:38:38 +05:00
Adeel Zafar
dc425c2199
Fix write settings permission bug
...
Write settings permission popping up on every restart.
Using Toast to display Wifi Hotspot Enabled/Disabled
2019-07-31 23:38:38 +05:00
Adeel Zafar
d4b0ea1dd3
Add menu item to turn on/off Wifi Hotspot
...
Initialize WifiManager object in MainActivity.
And work with WifiHotspotManager class.
2019-07-31 23:38:37 +05:00
Adeel Zafar
bd328b5d1d
Add method getWifiApState() and isWifiApEnabled()
...
It's used to get current state of wifi access point.
2019-07-31 23:38:36 +05:00
Adeel Zafar
8eff3c5d84
Add WIFI_AP_STATE_ENUMS
...
Declare enums to check the WifiAp state.
2019-07-31 23:38:36 +05:00
Adeel Zafar
2289a8821f
Add wifi hotspot manager class
...
This classes manages all the wifi-hotspot logic.
It uses WifiManager and WifiConfiguration classes by Android.
Add method to check show write permission settings.
Add method setWifiEnabled to setup wifi hotspot
Add setters/getters for WifiConfiguration
2019-07-31 23:38:35 +05:00
Adeel Zafar
f11bde6313
Added permissions to work with wifi-hotspot
...
Wifi related permissions.
Write system settings permission.
2019-07-31 23:38:35 +05:00
Seán Mac Gillicuddy
2957ea87f7
Merge pull request #1308 from kiwix/feature/macgills/#1307-autoformat
...
Feature/macgills/#1307 autoformat
2019-07-31 14:01:08 +01:00
Sean Mac Gillicuddy
c8a88284e0
#1307 update inspection profile to mirror gradle file
2019-07-31 13:18:39 +01:00
Sean Mac Gillicuddy
49751be4f3
#1307 reduce iconDensity to warning
2019-07-31 13:14:40 +01:00