bonjour for embedded system - android

I have followed the steps provided in the install file to initialize the bonjour for embedded system . first I generated the shared ib for bonjour source code for my embedded system and then I initialized it by calling mDNS_Init api.
Since I just need to browse at my client , I called the browsing function as per dns_sd.h , but I got the below error .
mDNS_StartBrowse: mDNSPlatformRawTime went backwards by 1669225997 ticks; setting correction factor to 1669225997
11-17 00:28:08.481: D/bonjour(1280): mDNS_StartBrowse: mDNS_Unlock: ERROR! m->timenow aready zero
11-17 00:28:08.481: D/bonjour(1280): DNSServiceBrowse("_appl._tcp.", "local.") failed: mDNS_StartBrowse (-65546)
11-17 00:28:08.490: I/System.out(1280): DNSService call failed -65546
11-17 00:32:24.720: E/ThrottleService(161): problem during onPollAlarm: java.lang.IllegalStateException: problem parsing stats:
I posted in the apple forum but I have nit received any help for this problem ..

Related

com.samsung.android.simplehealth E/SimpleHealth: Getting step count fails

I'm trying to use Samsung sample SimpleHealth for retrieving data from Samsung Health app, but when I give the permission to get StepCount data, I get a weird error:
java.lang.SecurityException: com.samsung.android.simplehealth does not match with registered signature. 4A:E1:B9:8D:04\
at android.os.Parcel.createException(Parcel.java:2074)\
at android.os.Parcel.readException(Parcel.java:2042)\
at android.os.Parcel.readException(Parcel.java:1990)\
at com.samsung.android.sdk.healthdata.IDataResolver$Stub$Proxy.readData2(IDataResolver.java:588)\
at com.samsung.android.sdk.healthdata.HealthDataResolver.read(HealthDataResolver.java:576)\
at com.samsung.android.simplehealth.StepCountReporter.readTodayStepCount(StepCountReporter.java:67)\
at com.samsung.android.simplehealth.StepCountReporter.start(StepCountReporter.java:48)\
at com.samsung.android.simplehealth.MainActivity$1.onConnected(MainActivity.java:72)\
at com.samsung.android.sdk.healthdata.HealthDataStore$ErrorMessageHandler.handleMessage(HealthDataStore.java:593)\
at android.os.Handler.dispatchMessage(Handler.java:107)\
at android.os.Looper.loop(Looper.java:224)\
at android.app.ActivityThread.main(ActivityThread.java:7548)\
at java.lang.reflect.Method.invoke(Native Method)\
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)\
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Faced same error. You need to add dev access code.
Follow Prerequisites section carefully from this page https://developer.samsung.com/health/android/sample/simple-health.html

Using ACRA with tracepot as backend

I have just finished my first android app as part of a school project ..one of my friends encountered a problem while trying to explore one of the activities in the app ..so i searched for solutions to get the crashes reports whenever they happen to fix the bugs ..i came across ACRA ..and I followed one of SO threads to setup ACRA to my app ..
RESULT: when the crashs happens the gmail app get launch in the device and the user (if he want to) he'll send the crash report by email ..Consedering not all users will want to ..i found in a comment in one of the SO threads that some developers use tracepot.
so i have used their link for integration in formUri but exploring my account on tracepot i get nothing ..is there something i am doing wrong (or if there is a better solution than using tracepot a backend , please suggest/explain or link a good tutorial, thanks!)
MyApplication.Java ( AFTER EDITING
#ReportsCrashes(
formUri = "https://collector.tracepot.com/79b1***",
reportType = org.acra.sender.HttpSender.Type.JSON,
httpMethod = org.acra.sender.HttpSender.Method.PUT,
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text
)
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
CaocConfig.Builder.create()
//.errorActivity(CustomErrorActivity.class) //default: null (default error activity)
.apply();
// The following line triggers the initialization of ACRA
ACRA.init(this);
}
}
EDIT :
msg in logcat if i use the http and email:
09-17 18:37:33.700 14329-14812/ma.ac.iav.menunaviagtion:acra W/ACRA: ma.ac.iav.menunaviagtion reports will be sent by email (if accepted by user).
09-17 18:37:33.703 14329-14812/ma.ac.iav.menunaviagtion:acra I/ACRA: Sending report /data/user/0/ma.ac.iav.menunaviagtion/app_ACRA-approved/2018-09-17T18:37:33.441+01:00-IS_SILENT.stacktrace
if i use only the http :
09-17 22:47:00.648 20116-20137/ma.ac.iav.myapplication:acra E/ACRA: Failed to send crash report for /data/user/0/ma.ac.iav.myapplication/app_ACRA-approved/2018-09-17T22:44:52.199+00:00-IS_SILENT.stacktrace
IMPLEMENTATION:
compile 'ch.acra:acra:4.9.2'
LOGCAT FOR F43nd1r
09-18 01:39:49.631 18508-18803/? E/AndroidRuntime: FATAL EXCEPTION: Thread-5
Process: ma.ac.iav.myapplication, PID: 18508
java.lang.InternalError: Thread starting during runtime shutdown
at java.lang.Thread.nativeCreate(Native Method)
at java.lang.Thread.start(Thread.java:733)
at android.app.SharedPreferencesImpl.startLoadFromDisk(SharedPreferencesImpl.java:119)
at android.app.SharedPreferencesImpl.<init>(SharedPreferencesImpl.java:112)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:392)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:373)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash.getLastCrashTimestamp(CustomActivityOnCrash.java:673)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash.hasCrashedInTheLastSeconds(CustomActivityOnCrash.java:683)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash.access$200(CustomActivityOnCrash.java:52)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash$1.uncaughtException(CustomActivityOnCrash.java:112)
at org.acra.builder.ReportExecutor.endApplication(ReportExecutor.java:269)
at org.acra.builder.ReportExecutor.dialogAndEnd(ReportExecutor.java:254)
at org.acra.builder.ReportExecutor.access$400(ReportExecutor.java:42)
at org.acra.builder.ReportExecutor$2.run(ReportExecutor.java:217)
By default, if the mail config is present, Acra 4 will send via mail and nothing else.
To use both you'd have to configure the reportSenderFactories.
400: Client error
Indicates that tracepot rejected your report. This could have multiple reasons. To find out what the problem is, call ACRA.DEV_LOGGING = true; right before ACRA.init and post all logcat with the ACRA tag.
Also note that ACRA 4.9.2 does not support android Oreo and above, it is recommended to upgrade to at least ACRA 4.11, or just the newest version 5.2.0.
You are not sending all required fields to Tracepot.
https://tracepot.uservoice.com/knowledgebase/articles/355272-what-are-the-required-fields-acra-needs-to-send
ANDROID_VERSION
APP_VERSION_CODE
APP_VERSION_NAME
PACKAGE_NAME
REPORT_ID
STACK_TRACE
USER_APP_START_DATE
USER_CRASH_DATE

UrbanAirship: Error setting tags on namedUser

Following the instructions on UrbanAirship documentation, I need to add a TagGroup to a namedUser with this lines of code on a demo App in Android
airship.getPushManager().getNamedUser().setId("123456");
airship.getPushManager().getNamedUser().editTagGroups().addTag("loyalty", "elite").apply();
But, the LogCat shows this error:
D/UrbanAirshipDemo - UALib﹕ Received a response for tag groups: Response: ResponseBody: ResponseHeaders: {null=[HTTP/1.1 400 Bad Request], Connection=[close, Transfer-Encoding], Content-Type=[application/vnd.urbanairship+json; version=3], Date=[Wed, 24 Jun 2015 20:02:06 GMT], Transfer-Encoding=[chunked], X-Android-Received-Millis=[1435176126629], X-Android-Response-Source=[NETWORK 400], X-Android-Sent-Millis=[1435176126427]} ResponseMessage: Bad Request Status: 400
E/UrbanAirshipDemo - UALib﹕ Update tag groups failed with status: 400
E/UrbanAirshipDemo - UALib﹕ Both add & remove fields are present and the intersection of the tags in these fields is not empty.
Is it something weird on their API? Instructions from here: http://docs.urbanairship.com/platform/android.html#named-user-tag-groups
Is just simple the implementation, but their API is returning 400. Push notifications are working fine
I was able to reproduce the same issue. The error message is incorrect, the real issue is the tag group does not exists yet. Groups can only be created through Go. Try creating the group following - http://docs.urbanairship.com/topic-guides/tag-groups-walkthrough.html#create-a-tag-group and try again.
The error message will be fixed in a future release.

Access scope using Kind Name on Google Cloud / Android Mobile Backend Starter

Documentation for the Google Cloud MBS states that access to stored Entities can be controlled via prefixing the KindName of that entity with strings "[public]" or "[private]" (or nothing).
https://cloud.google.com/developers/articles/mobile-backend-starter-api-reference#acfce
However attempting insertion of CloudEntities into the Datastore using KindNames that start with [public] or [private] causes an exception/error, specifically that the KindName is invalid.
This is the case both for the Backend running in Open and in Secured mode (using Google login credentials to derive the _owner field)
e.g. here I use KindName "[public]TestDB" which fails, whereas "TestDB" would not throw any exception.
04-22 19:57:54.132: E/AndroidRuntime(4690): Process: com.example.package, PID: 4690
04-22 19:57:54.132: E/AndroidRuntime(4690): java.lang.IllegalArgumentException: Illegal kind name: [public]TestDB
04-22 19:57:54.132: E/AndroidRuntime(4690): at com.google.cloud.backend.core.CloudEntity.(CloudEntity.java:86)
04-22 19:57:54.132: E/AndroidRuntime(4690): at com.example.package.CloudUtil.convertUpdatesToCEList(CloudUtil.java:252)
04-22 19:57:54.132: E/AndroidRuntime(4690): at com.example.package.CloudUtil.checkSync(CloudUtil.java:199)
The relevant section of code editted/compressed for brevity is:
CloudBackendMessaging cbm=_cloudfrag.getCloudBackend();
List<CloudEntity> entries=new ArrayList<CloudEntity>();
while (...) {
CloudEntity ce=new CloudEntity(_CLOUD_DB_KIND);
ce.put("fieldname", devID);
entries.add(ce);
}
_countActivity.runOnUiThread(new Runnable() {
#Override
public void run() {
cbm.updateAll(entries, handler);
}
});
Where handler is the callback and _cloudfrag is the CloudBackendFragment from the sample code.
I get the same effect using both inserts and updates, for single or multiple i.e. lists of entities at a time.
I can only think I'm misunderstanding the documentation - but it seems fairly explicit that KindNames can begin with [public] [private] etc?
Judging by the bug reports on github from others experiencing the same issue, this is a bug in Google's MBS library.
Unfortunately the response to this has been silence for months until tonight the devs posted a single commit updating the readme file to indicate this library is no longer supported and is not an official google product (despite it being pushed as a starter kit with every cloud project started from the console!).
https://github.com/GoogleCloudPlatform/solutions-mobile-backend-starter-android-client/pull/16
Looking at the source I think this access modifier feature was never actually implemented despite documentation to the contrary.

Error Codes Media Player syntax and definition

I cannot find any documentation on error codes with regard to Android. I am putting together an app that seemed to be working on a lower level API setup but not on a higher one.
The error occurs when trying to play an audio file and like I said it all worked in a lower version.
The error code I see is in the log are:
MediaPlayer info/warning (1, 32)
MediaPlayer Info (1,32)
MediaPlayer info/warning (1,26)
MediaPlayer Info (1,26)
MediaPlayer error(351, -4)
MediaPlayer Error(351,-4)
VideoView Error(351,-4)
So can someone please explain how this works in detail?
I know I have an error in MediaPlayer and possibly VideoView as per the data above but what do the numbers represent? I assume it is a particular error but which one?
I can not seem to find anything on this and how this is decoded.
Where can I find documentation on how to find out what this means that is the main question.
If I can get an answer for this particular error code even better, but again the actual documentation source so I may be able to look up additional codes myself would be of great benefit also.
Here is the exact logfile as exported by Eclipse:
07-04 12:22:48.298: V/key =(6969): http://xxxxxx/glennharrold/audio/normal/relaxsleepwellfull.mp3
07-04 12:22:48.388: D/MediaPlayer(6969): Couldn't open file on client side, trying server side
07-04 12:22:48.388: D/SprintMM(6969): Proxy will be bypassed because of WIFI connection.
07-04 12:22:48.508: W/MediaPlayer(6969): info/warning (1, 32)
07-04 12:22:48.508: I/MediaPlayer(6969): Info (1,32)
07-04 12:22:48.508: W/MediaPlayer(6969): info/warning (1, 26)
07-04 12:22:48.508: I/MediaPlayer(6969): Info (1,26)
07-04 12:22:48.508: E/MediaPlayer(6969): error (351, -4)
07-04 12:22:48.508: E/MediaPlayer(6969): Error (351,-4)
07-04 12:22:48.508: D/VideoView(6969): Error: 351,-4
Now what is unclear is exactly what means what I can see that it may have something to do with the file not being found on the client side but this exact same code works on a lower API version I copied working code to this App to make a new one.
The only thing I see in this that I did not see in my logcat in Eclipse is the (6969) and the D/, E/, W/, I/ in front of MediaPlayer text
don't know what this extra stuff means and it only appears when I export the code to a text file.
FYI, When logcat displays information it is one of the following:
D - D ebug
W - W arning
I - I nformation
Followed by a '/' with a identifier to identify the Java code name which is usually defined by TAG as in a standard practice of doing :
public class fooClass{
private static final String TAG = "fooClass";
// ... SNIP
}
Following that, is the process id of the Java code that is running in the DalvikVM, along with some informative error code/message depending on the program spec.
For example, continuing on from the Java class fooClass as highlighted above, suppose it has a function fooMethod like this:
private void fooMethod(){
Log.d(TAG, "fooMethod() - This is a debug message");
//
Log.i(TAG, "fooMethod() - This is a info message");
//
Log.w(TAG, "fooMethod() - This is a warning message");
}
Now that will show up in the log like this:
07-04 20:58:00 D/fooClass (1234): fooMethod() - This is a debug message
07-04 20:58:00 I/fooClass (1234): fooMethod() - This is a info message
07-04 20:58:00 W/fooClass (1234): fooMethod() - This is a warning message
Some apps, will elect to display the message at the programmer's discretion or display a cryptic message.
Notably within the Android framework itself, some services will display a meaningless message that has little significance to anyone except the developer(s) behind the ROM itself, to aid in troubleshooting.
Edit: Since the OP insisted on trying to nail down understanding this, here goes
The AOSP source code for the MediaPlayer lies on github here, look in there there's a reference to 'pvmf_return_codes.h' in the source on line number 1547, which, a quick google-fu lead to this linky. The error code and condition is as a result of incompatible or media error.

Categories

Resources