android-notify 1.24.4__tar.gz → 1.31__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of android-notify might be problematic. Click here for more details.

@@ -0,0 +1,361 @@
1
+ Metadata-Version: 2.1
2
+ Name: android-notify
3
+ Version: 1.31
4
+ Summary: A Python package that simpilfies creating Android Post notifications using PyJNIus in Kivy apps.
5
+ Home-page: https://github.com/fector101/android-notify
6
+ Author: Fabian
7
+ Author-email: fector101@yahoo.com
8
+ License: MIT
9
+ Project-URL: Documentation, https://github.com/fector101/android-notify/
10
+ Project-URL: Source, https://github.com/fector101/android-notify
11
+ Project-URL: Tracker, https://github.com/fector101/android-notify/issues
12
+ Project-URL: Funding, https://www.buymeacoffee.com/fector101
13
+ Keywords: android,notifications,kivy,mobile,post-notifications,pyjnius,android-notifications,kivy-notifications,python-android,mobile-development,push-notifications,mobile-app,kivy-application
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: Android
17
+ Classifier: Development Status :: 5 - Production/Stable
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.6
21
+ Description-Content-Type: text/markdown
22
+ Requires-Dist: kivy>=2.0.0
23
+ Requires-Dist: pyjnius>=1.4.2
24
+
25
+ <div align="center">
26
+ <br>
27
+ <h1> Android-Notifiy </h1>
28
+ <p> A Python library for effortlessly creating and managing Android notifications in Kivy android apps.</p>
29
+ <p>
30
+ Supports various styles and ensures seamless integration and customization.
31
+ </p>
32
+ <br>
33
+ <!-- <img src="https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/democollage.jpg"> -->
34
+ </div>
35
+
36
+ ## Features
37
+
38
+ - Compatible with Android 8.0+.
39
+ - Supports including images in notifications.
40
+ - Support for multiple notification styles:
41
+ - Progress
42
+ - Big Picture
43
+ - Inbox
44
+ - Big Text
45
+ - Large Icon
46
+
47
+ This module automatically handles:
48
+
49
+ - Permission requests for notifications
50
+ - Customizable notification channels.
51
+
52
+ ## Installation
53
+
54
+ This package is available on PyPI and can be installed via pip:
55
+
56
+ ```bash
57
+ pip install android-notify
58
+ ```
59
+
60
+ ## **Dependencies**
61
+
62
+ **Prerequisites:**
63
+
64
+ - Kivy
65
+
66
+ In your **`buildozer.spec`** file, ensure you include the following:
67
+
68
+ ```ini
69
+ # Add pyjnius so it's packaged with the build
70
+ requirements = python3, kivy, pyjnius, android-notify
71
+
72
+ # Add permission for notifications
73
+ android.permissions = POST_NOTIFICATIONS
74
+
75
+ # Required dependencies (write exactly as shown, no quotation marks)
76
+ android.gradle_dependencies = androidx.core:core:1.6.0, androidx.core:core-ktx:1.15.0
77
+ android.enable_androidx = True
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Basic Usage
83
+
84
+ ```python
85
+ from android_notify import Notification
86
+
87
+ # Create a simple notification
88
+ notification = Notification(
89
+ title="Hello",
90
+ message="This is a basic notification"
91
+ )
92
+ notification.send()
93
+ ```
94
+
95
+ **Sample Image:**
96
+ ![basic notification img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/basicnoti.jpg)
97
+
98
+ ## Notification Styles
99
+
100
+ The library supports multiple notification styles:
101
+
102
+ 1. `simple` - Basic notification with title and message
103
+ 2. `progress` - Shows a progress bar
104
+ 3. `big_text` - Expandable notification with long text
105
+ 4. `inbox` - List-style notification
106
+ 5. `big_picture` - Notification with a large image
107
+ 6. `large_icon` - Notification with a custom icon
108
+ 7. `both_imgs` - Combines big picture and large icon
109
+ 8. `custom` - For custom notification styles
110
+
111
+ ### Style Examples
112
+
113
+ #### Notification with an Image (Big Picture Style)
114
+
115
+ ```python
116
+ # Image notification
117
+ notification = Notification(
118
+ title='Picture Alert!',
119
+ message='This notification includes an image.',
120
+ style="big_picture",
121
+ big_picture_path="assets/imgs/photo.png"
122
+ )
123
+ ```
124
+
125
+ **Sample Image:**
126
+ ![big_picture img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/bigpicturenoti.jpg)
127
+
128
+ #### Inbox Notification Style
129
+
130
+ ```python
131
+ # Send a notification with inbox style
132
+ notification = Notification(
133
+ title='Inbox Notification',
134
+ message='Line 1\nLine 2\nLine 3',
135
+ style='inbox'
136
+ )
137
+ ```
138
+
139
+ **Sample Image:**
140
+ ![Inbox Notification sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/inboxnoti.jpg)
141
+
142
+ #### Big text notification (Will Display as simple text if Device dosen't support)
143
+
144
+ ```python
145
+ notification = Notification(
146
+ title="Article",
147
+ message="Long article content...",
148
+ style="big_text"
149
+ )
150
+ ```
151
+
152
+ #### Progress bar notification
153
+
154
+ ```python
155
+ import time
156
+ notification = Notification(
157
+ title="Downloading...",
158
+ message="0% downloaded",
159
+ style="progress",
160
+ progress_max_value=100,
161
+ progress_current_value=0
162
+ )
163
+ notification.send()
164
+ time.sleep(350)
165
+ notification.updateProgressBar(30, "30% downloaded")
166
+
167
+
168
+ ```
169
+
170
+ **Sample Image:**
171
+ ![progress img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/progress.jpg)
172
+
173
+ #### Notification with an Image (Large Icon Style)
174
+
175
+ ```python
176
+ notification = Notification(
177
+ title="Completed download",
178
+ message="profile.jpg",
179
+ style="large_icon",
180
+ large_icon_path="assets/imgs/profile.png"
181
+ )
182
+
183
+ ```
184
+
185
+ **Sample Image:**
186
+ ![large_icon img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/large_icon.jpg)
187
+
188
+ ## Advanced Features
189
+
190
+ ### Updating Notifications
191
+
192
+ ```python
193
+ notification = Notification(title="Initial Title")
194
+ notification.send()
195
+
196
+ # Update title
197
+ notification.updateTitle("New Title")
198
+
199
+ # Update message
200
+ notification.updateMessage("New Message")
201
+ ```
202
+
203
+ ### Progress Bar Management
204
+
205
+ ```python
206
+ notification = Notification(
207
+ title="Download..",
208
+ style="progress"
209
+ )
210
+
211
+ # Update progress
212
+ notification.updateProgressBar(30, "30% downloaded")
213
+
214
+ # Remove progress bar
215
+ notification.removeProgressBar("Download Complete")
216
+ ```
217
+
218
+ ### Channel Management
219
+
220
+ Notifications are organized into channels. You can customize the channel name and ID:
221
+
222
+ - Custom Channel Name's Gives User ability to turn on/off specific
223
+
224
+ ```python
225
+ notification = Notification(
226
+ title="Download finished",
227
+ message="How to Catch a Fish.mp4",
228
+ channel_name="Download Notifications", # Will create User-visible name "downloads"
229
+ channel_id="custom_downloads" # Optional: specify custom channel ID
230
+ )
231
+ ```
232
+
233
+ **Sample Image:**
234
+ ![channels img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/channel_name.jpg)
235
+
236
+ ### Silent Notifications
237
+
238
+ To send a notification without sound or heads-up display:
239
+
240
+ ```python
241
+ notification = Notification(title="Silent Update")
242
+ notification.send(silent=True)
243
+ ```
244
+
245
+ ### Assist
246
+
247
+ - How to Copy image to app folder
248
+
249
+ ```python
250
+ import shutil,os # These modules come packaged with python
251
+ from android.storage import app_storage_path # type: ignore -- This works only on android
252
+
253
+ app_path = os.path.join(app_storage_path(),'app')
254
+ image_path= "/storage/emulated/0/Download/profile.png"
255
+
256
+ shutil.copy(image_path, os.path.join(app_path, "profile.png"))
257
+ ```
258
+
259
+ - Avoiding Human Error when using different notification styles
260
+
261
+ ```python
262
+ from android_notify import Notification, NotificationStyles
263
+ notification = Notification(
264
+ title="New Photo",
265
+ message="Check out this image",
266
+ style=NotificationStyles.BIG_PICTURE,
267
+ big_picture_path="assets/imgs/photo.png"
268
+ ).send()
269
+ ```
270
+
271
+ ## Development Mode
272
+
273
+ When developing on non-Android platforms, the library provides debugging output:
274
+
275
+ ```python
276
+ # Enable logs (default is True when not on Android)
277
+ Notification.logs = True
278
+
279
+ # Create notification for testing
280
+ notification = Notification(title="Test")
281
+ notification.send()
282
+ # Will print notification properties instead of sending
283
+ ```
284
+
285
+ ## Image Requirements
286
+
287
+ - Images must be located within your app's asset folder
288
+ - Supported paths are relative to your app's storage path
289
+ - Example: `assets/imgs/icon.png`
290
+
291
+ ## Error Handling
292
+
293
+ The library validates arguments and provides helpful error messages:
294
+
295
+ - Invalid style names will suggest the closest matching style
296
+ - Invalid arguments will list all valid options
297
+ - Missing image files will raise FileNotFoundError with the attempted path
298
+
299
+ ## Limitations
300
+
301
+ 1. Only works on Android devices
302
+ 2. Images must be within the app's storage path
303
+ 3. Channel names are limited to 40 characters
304
+ 4. Channel IDs are limited to 50 characters
305
+
306
+ ## Best Practices
307
+
308
+ 1. Always handle permissions appropriately
309
+ 2. Use meaningful channel names for organization
310
+ 3. Keep progress bar updates reasonable (don't update too frequently)
311
+ 4. Test notifications on different Android versions
312
+ 5. Consider using silent notifications for frequent updates
313
+
314
+ ## Debugging Tips
315
+
316
+ 1. Enable logs during development: `Notification.logs = True`
317
+ 2. Check channel creation with Android's notification settings
318
+ 3. Verify image paths before sending notifications
319
+ 4. Test different styles to ensure proper display
320
+
321
+ Remember to check Android's notification documentation for best practices and guidelines regarding notification frequency and content.
322
+
323
+ ## Contribution
324
+
325
+ Feel free to open issues or submit pull requests for improvements!
326
+
327
+ ## Reporting Issues
328
+
329
+ Found a bug? Please open an issue on our [GitHub Issues](https://github.com/Fector101/android_notify/issues) page.
330
+
331
+ ## Author
332
+
333
+ - Fabian - <fector101@yahoo.com>
334
+ - GitHub: [Android Notify Repo](https://github.com/Fector101/android_notify)
335
+ - Twitter: [FabianDev_](https://twitter.com/intent/user?user_id=1246911115319263233)
336
+
337
+ For feedback or contributions, feel free to reach out!
338
+
339
+ ---
340
+
341
+ ## ☕ Support the Project
342
+
343
+ If you find this project helpful, consider buying me a coffee! 😊 Or Giving it a star on 🌟 [GitHub](https://github.com/Fector101/android_notify/) Your support helps maintain and improve the project.
344
+
345
+ <a href="https://www.buymeacoffee.com/fector101" target="_blank">
346
+ <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60">
347
+ </a>
348
+
349
+ ---
350
+
351
+ ## Acknowledgments
352
+
353
+ - This Project was thoroughly Tested by the [Laner Project](https://github.com/Fector101/Laner/) - A application for Securely Transfering Files Wirelessly between your PC and Phone.
354
+ - Thanks to the Kivy and Pyjnius communities.
355
+
356
+ ---
357
+
358
+ ## 🌐 **Links**
359
+
360
+ - **PyPI:** [android-notify on PyPI](https://pypi.org/project/android-notify/)
361
+ - **GitHub:** [Source Code Repository](https://github.com/Fector101/android_notify/)
@@ -0,0 +1,337 @@
1
+ <div align="center">
2
+ <br>
3
+ <h1> Android-Notifiy </h1>
4
+ <p> A Python library for effortlessly creating and managing Android notifications in Kivy android apps.</p>
5
+ <p>
6
+ Supports various styles and ensures seamless integration and customization.
7
+ </p>
8
+ <br>
9
+ <!-- <img src="https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/democollage.jpg"> -->
10
+ </div>
11
+
12
+ ## Features
13
+
14
+ - Compatible with Android 8.0+.
15
+ - Supports including images in notifications.
16
+ - Support for multiple notification styles:
17
+ - Progress
18
+ - Big Picture
19
+ - Inbox
20
+ - Big Text
21
+ - Large Icon
22
+
23
+ This module automatically handles:
24
+
25
+ - Permission requests for notifications
26
+ - Customizable notification channels.
27
+
28
+ ## Installation
29
+
30
+ This package is available on PyPI and can be installed via pip:
31
+
32
+ ```bash
33
+ pip install android-notify
34
+ ```
35
+
36
+ ## **Dependencies**
37
+
38
+ **Prerequisites:**
39
+
40
+ - Kivy
41
+
42
+ In your **`buildozer.spec`** file, ensure you include the following:
43
+
44
+ ```ini
45
+ # Add pyjnius so it's packaged with the build
46
+ requirements = python3, kivy, pyjnius, android-notify
47
+
48
+ # Add permission for notifications
49
+ android.permissions = POST_NOTIFICATIONS
50
+
51
+ # Required dependencies (write exactly as shown, no quotation marks)
52
+ android.gradle_dependencies = androidx.core:core:1.6.0, androidx.core:core-ktx:1.15.0
53
+ android.enable_androidx = True
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Basic Usage
59
+
60
+ ```python
61
+ from android_notify import Notification
62
+
63
+ # Create a simple notification
64
+ notification = Notification(
65
+ title="Hello",
66
+ message="This is a basic notification"
67
+ )
68
+ notification.send()
69
+ ```
70
+
71
+ **Sample Image:**
72
+ ![basic notification img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/basicnoti.jpg)
73
+
74
+ ## Notification Styles
75
+
76
+ The library supports multiple notification styles:
77
+
78
+ 1. `simple` - Basic notification with title and message
79
+ 2. `progress` - Shows a progress bar
80
+ 3. `big_text` - Expandable notification with long text
81
+ 4. `inbox` - List-style notification
82
+ 5. `big_picture` - Notification with a large image
83
+ 6. `large_icon` - Notification with a custom icon
84
+ 7. `both_imgs` - Combines big picture and large icon
85
+ 8. `custom` - For custom notification styles
86
+
87
+ ### Style Examples
88
+
89
+ #### Notification with an Image (Big Picture Style)
90
+
91
+ ```python
92
+ # Image notification
93
+ notification = Notification(
94
+ title='Picture Alert!',
95
+ message='This notification includes an image.',
96
+ style="big_picture",
97
+ big_picture_path="assets/imgs/photo.png"
98
+ )
99
+ ```
100
+
101
+ **Sample Image:**
102
+ ![big_picture img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/bigpicturenoti.jpg)
103
+
104
+ #### Inbox Notification Style
105
+
106
+ ```python
107
+ # Send a notification with inbox style
108
+ notification = Notification(
109
+ title='Inbox Notification',
110
+ message='Line 1\nLine 2\nLine 3',
111
+ style='inbox'
112
+ )
113
+ ```
114
+
115
+ **Sample Image:**
116
+ ![Inbox Notification sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/inboxnoti.jpg)
117
+
118
+ #### Big text notification (Will Display as simple text if Device dosen't support)
119
+
120
+ ```python
121
+ notification = Notification(
122
+ title="Article",
123
+ message="Long article content...",
124
+ style="big_text"
125
+ )
126
+ ```
127
+
128
+ #### Progress bar notification
129
+
130
+ ```python
131
+ import time
132
+ notification = Notification(
133
+ title="Downloading...",
134
+ message="0% downloaded",
135
+ style="progress",
136
+ progress_max_value=100,
137
+ progress_current_value=0
138
+ )
139
+ notification.send()
140
+ time.sleep(350)
141
+ notification.updateProgressBar(30, "30% downloaded")
142
+
143
+
144
+ ```
145
+
146
+ **Sample Image:**
147
+ ![progress img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/progress.jpg)
148
+
149
+ #### Notification with an Image (Large Icon Style)
150
+
151
+ ```python
152
+ notification = Notification(
153
+ title="Completed download",
154
+ message="profile.jpg",
155
+ style="large_icon",
156
+ large_icon_path="assets/imgs/profile.png"
157
+ )
158
+
159
+ ```
160
+
161
+ **Sample Image:**
162
+ ![large_icon img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/large_icon.jpg)
163
+
164
+ ## Advanced Features
165
+
166
+ ### Updating Notifications
167
+
168
+ ```python
169
+ notification = Notification(title="Initial Title")
170
+ notification.send()
171
+
172
+ # Update title
173
+ notification.updateTitle("New Title")
174
+
175
+ # Update message
176
+ notification.updateMessage("New Message")
177
+ ```
178
+
179
+ ### Progress Bar Management
180
+
181
+ ```python
182
+ notification = Notification(
183
+ title="Download..",
184
+ style="progress"
185
+ )
186
+
187
+ # Update progress
188
+ notification.updateProgressBar(30, "30% downloaded")
189
+
190
+ # Remove progress bar
191
+ notification.removeProgressBar("Download Complete")
192
+ ```
193
+
194
+ ### Channel Management
195
+
196
+ Notifications are organized into channels. You can customize the channel name and ID:
197
+
198
+ - Custom Channel Name's Gives User ability to turn on/off specific
199
+
200
+ ```python
201
+ notification = Notification(
202
+ title="Download finished",
203
+ message="How to Catch a Fish.mp4",
204
+ channel_name="Download Notifications", # Will create User-visible name "downloads"
205
+ channel_id="custom_downloads" # Optional: specify custom channel ID
206
+ )
207
+ ```
208
+
209
+ **Sample Image:**
210
+ ![channels img sample](https://raw.githubusercontent.com/Fector101/android_notify/main/docs/imgs/channel_name.jpg)
211
+
212
+ ### Silent Notifications
213
+
214
+ To send a notification without sound or heads-up display:
215
+
216
+ ```python
217
+ notification = Notification(title="Silent Update")
218
+ notification.send(silent=True)
219
+ ```
220
+
221
+ ### Assist
222
+
223
+ - How to Copy image to app folder
224
+
225
+ ```python
226
+ import shutil,os # These modules come packaged with python
227
+ from android.storage import app_storage_path # type: ignore -- This works only on android
228
+
229
+ app_path = os.path.join(app_storage_path(),'app')
230
+ image_path= "/storage/emulated/0/Download/profile.png"
231
+
232
+ shutil.copy(image_path, os.path.join(app_path, "profile.png"))
233
+ ```
234
+
235
+ - Avoiding Human Error when using different notification styles
236
+
237
+ ```python
238
+ from android_notify import Notification, NotificationStyles
239
+ notification = Notification(
240
+ title="New Photo",
241
+ message="Check out this image",
242
+ style=NotificationStyles.BIG_PICTURE,
243
+ big_picture_path="assets/imgs/photo.png"
244
+ ).send()
245
+ ```
246
+
247
+ ## Development Mode
248
+
249
+ When developing on non-Android platforms, the library provides debugging output:
250
+
251
+ ```python
252
+ # Enable logs (default is True when not on Android)
253
+ Notification.logs = True
254
+
255
+ # Create notification for testing
256
+ notification = Notification(title="Test")
257
+ notification.send()
258
+ # Will print notification properties instead of sending
259
+ ```
260
+
261
+ ## Image Requirements
262
+
263
+ - Images must be located within your app's asset folder
264
+ - Supported paths are relative to your app's storage path
265
+ - Example: `assets/imgs/icon.png`
266
+
267
+ ## Error Handling
268
+
269
+ The library validates arguments and provides helpful error messages:
270
+
271
+ - Invalid style names will suggest the closest matching style
272
+ - Invalid arguments will list all valid options
273
+ - Missing image files will raise FileNotFoundError with the attempted path
274
+
275
+ ## Limitations
276
+
277
+ 1. Only works on Android devices
278
+ 2. Images must be within the app's storage path
279
+ 3. Channel names are limited to 40 characters
280
+ 4. Channel IDs are limited to 50 characters
281
+
282
+ ## Best Practices
283
+
284
+ 1. Always handle permissions appropriately
285
+ 2. Use meaningful channel names for organization
286
+ 3. Keep progress bar updates reasonable (don't update too frequently)
287
+ 4. Test notifications on different Android versions
288
+ 5. Consider using silent notifications for frequent updates
289
+
290
+ ## Debugging Tips
291
+
292
+ 1. Enable logs during development: `Notification.logs = True`
293
+ 2. Check channel creation with Android's notification settings
294
+ 3. Verify image paths before sending notifications
295
+ 4. Test different styles to ensure proper display
296
+
297
+ Remember to check Android's notification documentation for best practices and guidelines regarding notification frequency and content.
298
+
299
+ ## Contribution
300
+
301
+ Feel free to open issues or submit pull requests for improvements!
302
+
303
+ ## Reporting Issues
304
+
305
+ Found a bug? Please open an issue on our [GitHub Issues](https://github.com/Fector101/android_notify/issues) page.
306
+
307
+ ## Author
308
+
309
+ - Fabian - <fector101@yahoo.com>
310
+ - GitHub: [Android Notify Repo](https://github.com/Fector101/android_notify)
311
+ - Twitter: [FabianDev_](https://twitter.com/intent/user?user_id=1246911115319263233)
312
+
313
+ For feedback or contributions, feel free to reach out!
314
+
315
+ ---
316
+
317
+ ## ☕ Support the Project
318
+
319
+ If you find this project helpful, consider buying me a coffee! 😊 Or Giving it a star on 🌟 [GitHub](https://github.com/Fector101/android_notify/) Your support helps maintain and improve the project.
320
+
321
+ <a href="https://www.buymeacoffee.com/fector101" target="_blank">
322
+ <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60">
323
+ </a>
324
+
325
+ ---
326
+
327
+ ## Acknowledgments
328
+
329
+ - This Project was thoroughly Tested by the [Laner Project](https://github.com/Fector101/Laner/) - A application for Securely Transfering Files Wirelessly between your PC and Phone.
330
+ - Thanks to the Kivy and Pyjnius communities.
331
+
332
+ ---
333
+
334
+ ## 🌐 **Links**
335
+
336
+ - **PyPI:** [android-notify on PyPI](https://pypi.org/project/android-notify/)
337
+ - **GitHub:** [Source Code Repository](https://github.com/Fector101/android_notify/)
@@ -0,0 +1,3 @@
1
+ from .core import send_notification
2
+ from .styles import NotificationStyles
3
+ from .sword import Notification