All Projects → romellfudi → Voipussd

romellfudi / Voipussd

Licence: apache-2.0
📞 IMEI (USSD) Library on Android Devices by @romellfudi

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Voipussd

Eviacam
webcam based mouse emulator
Stars: ✭ 82 (-15.46%)
Mutual labels:  accessibility
Service
Android Service Examples
Stars: ✭ 91 (-6.19%)
Mutual labels:  service
Va11ys
Verified Accessibility Samples - Testing the accessibility of HTML & ARIA samples
Stars: ✭ 94 (-3.09%)
Mutual labels:  accessibility
A11y.css
This CSS file intends to warn developers about possible risks and mistakes that exist in HTML code. It can also be used to roughly evaluate a site's quality by simply including it as an external stylesheet.
Stars: ✭ 1,277 (+1216.49%)
Mutual labels:  accessibility
Plyr React
A simple, accessible and customisable react media player for Video, Audio, YouTube and Vimeo
Stars: ✭ 89 (-8.25%)
Mutual labels:  accessibility
Accessible Html Content Patterns
♿️ The full HTML5 Doctor Element Index as well as common markup patterns for quick reference.
Stars: ✭ 93 (-4.12%)
Mutual labels:  accessibility
Accesslint Ci
Install the GitHub Integration https://github.com/apps/accesslint
Stars: ✭ 82 (-15.46%)
Mutual labels:  accessibility
Algorithms
In case you want to contribute, ping on https://gitter.im/NITSkmOS/algo.
Stars: ✭ 95 (-2.06%)
Mutual labels:  gitter
Freeacs
(Seeking maintainer) Free TR-069 ACS that can run (mostly) anywhere.
Stars: ✭ 90 (-7.22%)
Mutual labels:  gitter
Accordion
Accordion module created in pure javascript & CSS. Very useful to create FAQ lists on your website.
Stars: ✭ 94 (-3.09%)
Mutual labels:  accessibility
Buddycss
The framework for people who love coding!
Stars: ✭ 89 (-8.25%)
Mutual labels:  accessibility
Thewarholoutloud
An inclusive audio guide for The Andy Warhol Museum
Stars: ✭ 89 (-8.25%)
Mutual labels:  accessibility
X
新生命X组件,数据中间件XCode、日志、网络、RPC、序列化、缓存、Windows服务
Stars: ✭ 1,322 (+1262.89%)
Mutual labels:  service
Core Components
Accessible and lightweight Javascript components
Stars: ✭ 85 (-12.37%)
Mutual labels:  accessibility
Date Picker
Duet Date Picker is an open source version of Duet Design System’s accessible date picker. Try live example at https://duetds.github.io/date-picker/
Stars: ✭ 1,325 (+1265.98%)
Mutual labels:  accessibility
Eva facial mouse
Camera based mouse emulator for Android
Stars: ✭ 83 (-14.43%)
Mutual labels:  accessibility
Dexter
Let your talking do the code
Stars: ✭ 93 (-4.12%)
Mutual labels:  accessibility
Flying Pigeon
flying-pigeon 是一个IPC 跨进程通信组件,底层是匿名内存+Binder , 突破1MB大小限制,无需写AIDL文件,让实现跨进程通信就像写一个接口一样简单
Stars: ✭ 97 (+0%)
Mutual labels:  service
Paysuper Billing Server
A core monolith-like service with all payment processing business logic in PaySuper.
Stars: ✭ 95 (-2.06%)
Mutual labels:  service
Ec2 Api
AWS EC2 and VPC API support in standalone service for OpenStack. Mirror of code maintained at opendev.org.
Stars: ✭ 93 (-4.12%)
Mutual labels:  service

VOIP USSD ANDROID

Platform API License Workflow Gitter Bintray Bintray Kotlin Android Arsenal Jitpack

Loved the tool? Please consider donating 💸 to help it improve!

sponsor voip android library

Usage    |    Extra Features    |    Cordova Plugin    |    Contributors

by Romell Dominguez

Target Development High Quality:

Jitpack

Interactive with ussd windoows, It is necessary to have present that the interface depends on the SO and on the manufacturer of Android device.

Community Chat

Gitter

Downloads Dashboard

Data Studio

USSD LIBRARY

latestVersion is

kotlinLatestVersion is

Add the following in your app's build.gradle file:

From American Telcoms

repositories {
    jcenter()
}
dependencies {
    // java
    implementation 'com.romellfudi.ussdlibrary:ussd-library:{latestVersion}'
    // kotlin
    implementation 'com.romellfudi.ussdlibrary:kotlin-ussd-library:{kotlinLatestVersion}'
}

From African Telcoms

repositories {
    maven { url 'https://jitpack.io' }// (jetpacking)
}
dependencies {
    // africa SNAPSHOT (jetpacking)
    // java
    implementation 'com.github.romellfudi.VoIpUSSD:ussd-library:africa-SNAPSHOT'
    implementation 'com.github.romellfudi.VoIpUSSD:ussd-library:alternative-SNAPSHOT'
    // kotlin
    implementation 'com.github.romellfudi.VoIpUSSD:kotlin-ussd-library:africa-SNAPSHOT'
    implementation 'com.github.romellfudi.VoIpUSSD:kotlin-ussd-library:alternative-SNAPSHOT'
}
  • Writing xml config file from here to res/xml folder (if necessary), this config file allow link between App and SO:
<?xml version="1.0" encoding="utf-8"?>
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
    .../>

Application

Puts dependencies on manifest, into manifest put CALL_PHONE, READ_PHONE_STATE and SYSTEM_ALERT_WINDOW:

    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

Add service:

java
    <service
        android:name="com.romellfudi.ussdlibrary.USSDService"
        android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
        <intent-filter>
            <action android:name="android.accessibilityservice.AccessibilityService" />
        </intent-filter>
        <meta-data
            android:name="android.accessibilityservice"
            android:resource="@xml/ussd_service" />
    </service>
kotlin
    <service
        android:name="com.romellfudi.ussdlibrary.USSDServiceKT"
        android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
        <intent-filter>
            <action android:name="android.accessibilityservice.AccessibilityService" />
        </intent-filter>
        <meta-data
            android:name="android.accessibilityservice"
            android:resource="@xml/ussd_service" />
    </service>

How use:

First you need an hashMap from detect witch USSD' response contains the login and error messages

KEY MESSAGE String Messages
KEY_LOGIN "espere","waiting","loading","esperando",...
KEY_ERROR "problema","problem","error","null",...
map = new HashMap<>();
map.put("KEY_LOGIN",new HashSet<>(Arrays.asList("espere", "waiting", "loading", "esperando")));
map.put("KEY_ERROR",new HashSet<>(Arrays.asList("problema", "problem", "error", "null")));
map = HashMap()
map["KEY_LOGIN"] = HashSet(Arrays.asList("espere", "waiting", "loading", "esperando"))
map["KEY_ERROR"] = HashSet(Arrays.asList("problema", "problem", "error", "null"))

Instance an object ussController with context

USSDApi ussdApi = USSDController.getInstance(context);
ussdApi.callUSSDInvoke(phoneNumber, map, new USSDController.CallbackInvoke() {
    @Override
    public void responseInvoke(String message) {
        // message has the response string data
        String dataToSend = "data"// <- send "data" into USSD's input text
        ussdApi.send(dataToSend,new USSDController.CallbackMessage(){
            @Override
            public void responseMessage(String message) {
                // message has the response string data from USSD
            }
        });
    }

    @Override
    public void over(String message) {
        // message has the response string data from USSD or error
        // response no have input text, NOT SEND ANY DATA
    }
});
USSDApi ussdApi = USSDController.getInstance(activity)
ussdApi.callUSSDOverlayInvoke(phoneNumber, map, object : USSDController.CallbackInvoke {
    override fun responseInvoke(message: String) {
        // message has the response string data
        var dataToSend = "data"// <- send "data" into USSD's input text
        ussdApi.send("1") { // it: response String
                // message has the response string data from USSD
        }
     }

    override fun over(message: String) {
        // message has the response string data from USSD or error
        // response no have input text, NOT SEND ANY DATA
    }
})

if you need work with your custom messages, use this structure:

ussdApi.callUSSDInvoke(phoneNumber, map, new USSDController.CallbackInvoke() {
    @Override
    public void responseInvoke(String message) {
        // first option list - select option 1
        ussdApi.send("1",new USSDController.CallbackMessage(){
            @Override
            public void responseMessage(String message) {
                // second option list - select option 1
                ussdApi.send("1",new USSDController.CallbackMessage(){
                    @Override
                    public void responseMessage(String message) {
                        ...
                    }
                });
            }
        });
    }

    @Override
    public void over(String message) {
        // message has the response string data from USSD
        // response no have input text, NOT SEND ANY DATA
    }
    ...
});
ussdApi.callUSSDOverlayInvoke(phoneNumber, map, object : USSDController.CallbackInvoke {
    override fun responseInvoke(message: String) {
        // first option list - select option 1
        ussdApi.send("1") { // it: response response
                // second option list - select option 1
                ussdApi.send("1") { // it: response message
                        ...
                }
        }
    }

    override fun over(message: String) {
        // message has the response string data from USSD
        // response no have input text, NOT SEND ANY DATA
    }
    ...
})

for dual sim support

ussdApi.callUSSDInvoke(phoneNumber, simSlot, map, new USSDController.CallbackInvoke() {
    ...
}
ussdApi.callUSSDOverlayInvoke(phoneNumber, simSlot, map, object : USSDController.CallbackInvoke {
    ...
}

Static Methods

In case use at android >= M, you could check previusly permissions, callInvoke and callUSSDOverlayInvoke methods check eneble too:

 # check if accessibility permissions is enable
    USSDController.verifyAccesibilityAccess(Activity)
 # check if overlay permissions is enable
    USSDController.verifyOverLay(Activity)

Overlay Service Widget (not required)

A huge problem working with ussd is you can not invisible, disenable, resize or put on back in progressDialog But now on Android O, Google allow build a nw kind permission from overlay widget, my solution was a widget call OverlayShowingService: For use need add permissions at AndroidManifest:

<uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION" />

Using the library you could use two ways:

SplashLoadingService

Add Broadcast Service:

<service android:name="com.romellfudi.ussdlibrary.SplashLoadingService"
         android:exported="false" />

Invoke like a normal service:

svc = new Intent(activity, SplashLoadingService.class);
// show layout
getActivity().startService();
ussdApi.callUSSDOverlayInvoke(phoneNumber, simSlot, map, new USSDController.CallbackInvoke() {
        ...
        // dismiss layout
        getActivity().stopService(svc);
        ...
}
svc = Intent(activity, OverlayShowingService::class.java)
// show layout
activity.startService(svc)
ussdApi.callUSSDOverlayInvoke(phoneNumber, map, object : USSDController.CallbackInvoke {
        ...
        // dismiss layout
        activity.stopService(svc)
        ...
}

Jitpack

EXTRA: Use Voip line

In this section leave the lines to call to Telcom (ussd number) for connected it:

ussdPhoneNumber = ussdPhoneNumber.replace("#", uri);
Uri uriPhone = Uri.parse("tel:" + ussdPhoneNumber);
context.startActivity(new Intent(Intent.ACTION_CALL, uriPhone));
ussdPhoneNumber = ussdPhoneNumber.replace("#", uri)
val uriPhone = Uri.parse("tel:$ussdPhoneNumber")
context.startActivity(Intent(Intent.ACTION_CALL, uri))

Once initialized the call will begin to receive and send the famous USSD windows

Cordova Plugin

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):


Romell D.Z. 福迪

💻

Abdullahi Yusuf

💻

Mohamed Hamdy Hasan

💻

Mohamed Daahir

💻

Ramy Mokako

🔌

License

MIT. See the LICENSE file for the copyright notice. 2017, January

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].