You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm able to run the sample in the library and send mms with image. Perfect.
But I can't add this functionnality in a project.
I've try it several times on existing project, on new projet, ...
Here is what I've done :
add the library to gradle and sync implementation 'com.klinkerapps:android-smsmms:5.1.0'
add the classes of sample (MMSReceiver, permissionActivity, Settings, ...)
add this code on my mainActivity (mainly based on the code of the sample in library
`@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean("request_permissions", true) &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
startActivity(new Intent(this, PermissionActivity.class));
finish();
return;
}
setContentView(R.layout.activity_main);
initSettings();
initViews();
initActions();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
add the necessary permissions, service , receiver in the manifest
The app is compiling and running. When I click on the send button it runs the sendMessage function but the transaction is not sending new message.
With the sample example I can see in the log cat this V/Transaction: using lollipop method for sending sms V/Transaction: using system method for sending
What did I miss ?
The text was updated successfully, but these errors were encountered:
I'm able to run the sample in the library and send mms with image. Perfect.
But I can't add this functionnality in a project.
I've try it several times on existing project, on new projet, ...
Here is what I've done :
add the library to gradle and sync
implementation 'com.klinkerapps:android-smsmms:5.1.0'
add the classes of sample (MMSReceiver, permissionActivity, Settings, ...)
add this code on my mainActivity (mainly based on the code of the sample in library
`@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
private void initSettings() {
settings = Settings.get(this);
}
private void initApns() {
ApnUtils.initDefaultApns(this, new ApnUtils.OnApnFinishedListener() {
@OverRide
public void onFinished() {
settings = Settings.get(MainActivity.this, true);
}
});
}
private void initViews() {
}
private void initActions() {
}
public void sendMessage() {
new Thread(new Runnable() {
@OverRide
public void run() {
com.klinker.android.send_message.Settings sendSettings = new com.klinker.android.send_message.Settings();
sendSettings.setMmsc(settings.getMmsc());
sendSettings.setProxy(settings.getMmsProxy());
sendSettings.setPort(settings.getMmsPort());
sendSettings.setUseSystemSending(true);
}`
add the necessary permissions, service , receiver in the manifest
The app is compiling and running. When I click on the send button it runs the sendMessage function but the transaction is not sending new message.
With the sample example I can see in the log cat this
V/Transaction: using lollipop method for sending sms V/Transaction: using system method for sending
What did I miss ?
The text was updated successfully, but these errors were encountered: