@@ -95,7 +95,7 @@ sharedPreferenceData.setValue("keyname", "value for that keyname");
95
95
// with key as 'token' to get the token
96
96
//
97
97
// return - this method will return result from server in string format
98
- //
98
+
99
99
ApiServices apiServices = new ApiServices (context);
100
100
apiServices. makeApiCall(apiName, requestMethod, parameters, jsonObject, hasToken);
101
101
```
@@ -166,7 +166,7 @@ dbHelper.executeDatabaseOperation(tableName, operation, values, hasConditions, c
166
166
// it is similar as in executeDatabaseOperation method's conditionalValues parameter.
167
167
//
168
168
// return - this method wull return Cursor with values or will return null
169
- //
169
+
170
170
dbHelper. executeSelectQuery(tableName, values, hasConditions, conditionalValues);
171
171
```
172
172
```
@@ -190,7 +190,7 @@ dbHelper.executeSelectQuery(tableName, values, hasConditions, conditionalValues)
190
190
//
191
191
// return - this method wull return count of records in the table
192
192
// either for entire table or for a single column
193
- //
193
+
194
194
dbHelper.getRecordCount(tableName, values, hasConditions, conditionalValues);
195
195
```
196
196
@@ -301,7 +301,7 @@ dbHelper.getRecordCount(tableName, values, hasConditions, conditionalValues);
301
301
app : typeface =" QuattrocentoSans-Regular.ttf" />
302
302
```
303
303
304
- ### Location
304
+ ### MyLocation class
305
305
306
306
> ** This class will get the current location of the user.**
307
307
``` java
@@ -336,7 +336,7 @@ private MyLocation.LocationResult locationResult = new Mylocation.LocationResult
336
336
myLocation. getLocation(this , locationResult);
337
337
```
338
338
339
- ### Location Address
339
+ ### LocationAddress class
340
340
341
341
> ** This class helps your to get the address of the current location or by using latitude and longitude.**
342
342
``` java
@@ -348,7 +348,6 @@ LocationAddress.getAddressFromLocation(
348
348
mLatitude, mLongitude, this ,
349
349
new GeocoderHandler ());
350
350
351
-
352
351
// this is the GeocoderHandler class where you'll get the address
353
352
private class GeocoderHandler extends Handler
354
353
{
@@ -360,8 +359,9 @@ private class GeocoderHandler extends Handler
360
359
case 1 :
361
360
362
361
Bundle bundle = msg. getData();
363
-
362
+
364
363
// note that subThoroughFare may return null sometimes.
364
+ // so you should manage it accordling.
365
365
String address = bundle. getString(" subThoroughFare" ) + " , " +
366
366
bundle. getString(" thoroughFare" );
367
367
@@ -385,3 +385,79 @@ private class GeocoderHandler extends Handler
385
385
}
386
386
```
387
387
388
+ ### FontHelper Class
389
+ > ** This class helps you to apply the font to the entire layout file. This file will apply the required font to every view of the layout file.**
390
+
391
+ ``` java
392
+ // Example usage
393
+ FontHelper . applyFont(context, idOfYourParentLayout, " fonts/QuattrocentoSans-Regular.ttf" );
394
+ ```
395
+
396
+ ### InternetConection class
397
+ > ** This class will help you check if internet connection is available or not.**
398
+
399
+ ``` java
400
+ InternetConnection ic = InternetConnection . getInstanceInternet(context);
401
+ if (ic. isNetworkAvailable())
402
+ {
403
+ // internet is available
404
+ }
405
+ else
406
+ {
407
+ // internet is not available
408
+ }
409
+ ```
410
+
411
+ ### TextUtitlities class
412
+
413
+ > ** This class helps you replaces values, like replacing 'null' with empty string, replacing true or false with 1 or 0, etc.**
414
+
415
+ ``` java
416
+ // example: for replacing null value from a string.
417
+ TextUtilities . replaceNull(string); // this will return string value.
418
+
419
+ // example: for replacing True or False from a string.
420
+ TextUtilities . replaceTrueOrFalse(string); // this will return int value.
421
+ ```
422
+
423
+ ### Validator class
424
+ > ** This class helps you to validate some common fields like email, mobile number, numbers only, etc.**
425
+
426
+ ``` java
427
+ // validating an email id, returns true or false.
428
+ Validator . validateEmail(" example@gmail.com" );
429
+
430
+ // validating mobile no, returns true or false.
431
+ Validator . validateMobile(" 9999955555" );
432
+
433
+ // validating Pan Card (For Indian Format), returns true or false.
434
+ Validator . validatePanCard(" AAAAA0000A" );
435
+
436
+ // only numbers validation, returns true or false.
437
+ Validator . onlyNumbers(" 123456" );
438
+
439
+ // only characters validation, returns true or false.
440
+ Validator . onlyCharacters(" abcd" );
441
+
442
+ // atLeastOneLowerCase validation, returns true or false.
443
+ Validator . atLeastOneLowerCase(" ABcD" );
444
+
445
+ // atLeastOneUpperCase validation, returns true or false.
446
+ Validator . atLeastOneUpperCase(" abCd" );
447
+
448
+ // atLeastOneNumber validation, returns true or false.
449
+ Validator . atLeastOneNumber(" abcd1" );
450
+
451
+ // nonEmpty validation, returns true or false.
452
+ Validator . nonEmpty(" d" );
453
+
454
+ // startsWithNonNumber validation, returns true or false.
455
+ Validator . startsWithNonNumber(" a12" );
456
+
457
+ // noSpecialCharacters validation, returns true or false.
458
+ Validator . noSpecialCharacters(" abcd123" );
459
+
460
+ // atLeastOneSpecialCharacters validation, returns true or false.
461
+ Validator . atLeastOneSpecialCharacters(" abcd@123" );
462
+
463
+ ```
0 commit comments