I'm using cognalys sdk in my app for user verification but i get the errors 551 and 550 which are not listed on their site and I don't know what are they, here is the code I use:
Cognalys.verifyMobileNumber(SignupActivity.this,"token",
"id","number",
new VerificationListner() {
#Override
public void onVerificationStarted() {
Toast.makeText(getApplicationContext(), "Started", Toast.LENGTH_LONG).show();
}
#Override
public void onVerificationFailed(ArrayList<String> errorList) {
for (String error : errorList) {
Log.d("abx", "error:"+error);
}
Toast.makeText(getApplicationContext(), "Failed", Toast.LENGTH_LONG).show();
}
#Override
public void onVerificationSuccess() {
Toast.makeText(getApplicationContext(), "Signed up successfully !", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(SignupActivity.this, SetPictures.class);
startActivity(intent);
finish();
}
});
instead of number I put my number from my code, I get the missed call but the toast "failed" shows up with error 550 in my log, can anybody tell me what does it mean?
Error codes: https://www.cognalys.com/androidlibraryerrors/
Android lib source code: https://github.com/cognalys/cognalys-android-library
Don't use the jar from their website. Download the one on github and include it in your project. Then you have to make a change in their code.
In the class CallListnerHelper, when a call comes, the incoming number is compared to a list of numbers they send. On my Xperia Z3c, the incoming number starts with 00. They send the list of excepted number all starting with '+'. The comparison always fails, so you have to handle that. Use the following library: https://github.com/googlei18n/libphonenumber
We are now Sending number numbers list/array With + and 00 . Can you guys please re-check .We should know the problem is fixed or not . Thanks for the valuable update
Related
I'm trying to send String from my Moto 360 to Android App! but I don't understand how to implement the code in documentation, can anyone help me please with a little explanation of the steps to follow to send data !
http://developer.android.com/training/wearables/data-layer/messages.html
Take a look at a samples, this line exactly shows how to send a message:
http://developer.android.com/samples/DataLayer/Application/src/com.example.android.wearable.datalayer/MainActivity.html#l335
private void sendStartActivityMessage(String node) {
Wearable.MessageApi.sendMessage(
mGoogleApiClient, node, START_ACTIVITY_PATH, new byte[0]).setResultCallback(
new ResultCallback<SendMessageResult>() {
#Override
public void onResult(SendMessageResult sendMessageResult) {
if (!sendMessageResult.getStatus().isSuccess()) {
Log.e(TAG, "Failed to send message with status code: "
+ sendMessageResult.getStatus().getStatusCode());
}
}
}
);
}
If that's too much information, a simpler tutorial for MessageApi should be just a google search away. Try this one: http://www.binpress.com/tutorial/a-guide-to-the-android-wear-message-api/152 it looks reasonable.
I am integrating Twitter with my android Application for that I am using Twitter4j 3.0.3. till now everything is fine I have completed composing new Tweet,Upload Image,change profile picture. Now I want to show Tweets(composed by Signin User) .
For that I have used following tutorial and links
link 1
link 2
link 3
But I am not fully satisfied with these,I have tried one demo also but I am getting error of
Invalid cookie
header: “set-cookie: guest_id=v1%3A136932583219426033;
Domain=.twitter.com; Path=/; Expires=Sat, 23-May-2015 16:17:12 UTC”.
Unable to parse expires attribute: Sat, 23-May-2015 16:17:12 UTC
I tried to find out solution but I have found same solution everywhere like
Cookie Header
same issue like mine
they have shown the solution but I cant figure out where should I change in my code?
So I need one good example for Showing Tweets(which is done by User)in list view I have tried most examples as shown above, but I am getting error Invalid cookie
header: so please explain me in detail how should I fix these error?
I get Answer of My Question :)
Here it is .. :)
btn_getTweets.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
tweets_list.clear();
TwitterLogin.mTwitter.getUserTweets();
if(tweets_list.size()==0)
{
Toast.makeText(getApplicationContext(),"You haven't tweeted yet.", Toast.LENGTH_SHORT).show();
}
else
{
tweetsAdapter=new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1,tweets_list);
listView.setAdapter(tweetsAdapter);
}
}
});
where TwitterLogin.mTwitter class has store my Credentials.
and TwitterLogin.mTwitter.getUserTweets() is method is in other class Like
public void getUserTweets(){
System.out.println("Showing public timeline.");
try {
List<Status> statuses = mTwitter.getUserTimeline();
for (Status status : statuses) {
System.out.println(status.getUser().getName() + ":"
+ status.getText());
ComposeTwit.tweets_list.add(""+ status.getText());
}
Log.d("tweets_list Size", ""+ComposeTwit.tweets_list.size());
} catch (TwitterException te) {
System.out.println("Failed to get timeline: "
+ te.getMessage());
System.exit(-1);
}
}
I am trying to Integrating Aurasma in my application. All application work well but on Aurasma part when I launch it on Button Click IT throws a message on splash screen as "An error is occurred" and on Log Cat It shows "Resource integrity check failed" I am wondering why this is happening, I integrate aurasma on a separate application without any click event, it launches directly then it works but in side of my application its not working, why. I am sure about these points:
Make sure the SDK tools are version 14 or above.
Check the Eclipse project to make sure that AurasmaKernel is set as required on the build path
Check that the AurasmaKernel package has built properly in Eclipse (also try building it manually)
Make sure that the kernel is correctly extracted, and that your resources don't clash with any of the packaged library
But yet it not working same error message.
Code for launching Aurasma is below:
aurasmaIntent = AurasmaIntentFactory.getAurasmaLaunchIntent(HomeActivity.this,
getString(R.string.app_name), getString(R.string.app_version));
} catch (AurasmaLaunchException e) {
Log.e("AKTest", "Error getting intent", e);
showDialog(DIALOG_ERROR);
return;
}
if (DELAY_START) {
AurasmaSetupCallback callback = new AurasmaSetupCallback() {
#Override
public void onLoaded() {
dismissDialog(DIALOG_PROGRESS);
startActivity(aurasmaIntent);
}
#Override
public void onLoadWarning(final int code) {
Log.w("AKTest", "Preload warning: " + code);
}
#Override
public void onLoadFail(final int code) {
Log.e("AKTest", "Preload error: " + code);
dismissDialog(DIALOG_PROGRESS);
showDialog(DIALOG_ERROR);
}
};
showDialog(DIALOG_PROGRESS);
AurasmaIntentFactory.startAurasmaPreload(getApplicationContext(), aurasmaIntent,
callback);
} else {
startActivity(aurasmaIntent);
}
}
If you change some resource from Aurasma library(layout or string) you will get this error - "An error is occurred". Library checks resources on Aurasma start. Don't change or delete any files.
Another thing that can cause error is:
aurasmaIntent = AurasmaIntentFactory.getAurasmaLaunchIntent(HomeActivity.this,
getString(R.string.app_name), getString(R.string.app_version));
Here second parameter is userAgentName. This is the name of your app that you have from studio.aurasma.com. In "Make your own app" you can see the application name - this name is connected with your application but can be different.
check your minSdkVersion in the manifest
android:minSdkVersion="8"
I'm learning Bluetooth programming on Android using the Wrox Professional Android 2 Application Development book. The discovery monitor example (pg 432) has this code snippet:
BroadcastReceiver discoveryMonitor = new BroadcastReceiver() {
String dStarted = BluetoothAdapter.ACTION_DISCOVERY_STARTED;
String dFinished = BluetoothAdapter.ACTION_DISCOVERY_FINISHED;
#Override
public void onReceive(Context context, Intent intent) {
if (dStarted.equals(intent.getAction())) {
// Discovery has started.
Toast.makeText(getApplicationContext(),
"Discovery Started...", Toast.LENGTH_SHORT).show();
}
else if (dFinished.equals(intent.getAction())) {
// Discovery has completed.
Toast.makeText(getApplicationContext(),
"Discovery Completed...", Toast.LENGTH_SHORT).show();
}
}
};
registerReceiver(discoveryMonitor,
new IntentFilter(dStarted));
registerReceiver(discoveryMonitor,
new IntentFilter(dFinished));
... and on each of the two registerReceiver calls at the end I get . . .
Syntax error on tokens, AnnotationName expected instead
Syntax error, insert "Type VariableDeclaratorId" to complete FormalParameterList
What's an annotationName and what's going wrong here?
Thanks in advance!!
Your problem is that you defined variables dStarted and dFinished as locals for discoveryMonitor BroadcastReceiver,
That way, you can't use them in registerReceiver(...)
You have to define them as global, or use
registerReceiver(discoveryMonitor, new
IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_STARTED));
instead.
I have a button that sends message - however the onClick feature in the onClickListener seems to give me a few errors when I tell it to disable the button when click, AND when I set toast to it. Oh, and the error underlines 'else' saying syntax error. (Other than that the code works fine and sends the SMS)
public void onClick(View v)
{
messageinfo mi = new messageinfo();
String message = txtMessage.getText().toString();
if (message.length()>0)
sendSMS(mi.SMSNO(), smsmessage);
Toast.makeText(getBaseContext(), "sending", Toast.LENGTH_SHORT).show();
myButton.setEnabled(false);
else
Toast.makeText(getBaseContext(), "enter your message", Toast.LENGTH_SHORT).show();
}
Is there an easy solution to this?
Through formatting your code I've noticed that it would appear that your if statement is failing.
You need to have { }s around the resulting code from an if statement, eg:
if(true){
line 1;
line 2;
line 3;
}
else {
line 1;
line 2;
line 3;
}
The only time you can miss out the { }s is when you've only got ONE statement following an if. This is always a bad idea however, its not much effort just to put in some { }s, and means that issues like this won't ever happen.
Clarification
The code in your question is running the if and if it matches it runs THE NEXT LINE. Then the code carries on OUTSIDE of the if clause (because of missing brackets)so then will run the next two lines REGARDLESS of the outcome of the if statement.
Then it encounters the else which its not expecting. Its supposed to be after either { .. } or directly after the FIRST statement after the if, so that's why it fails at the else.