Detecting connect/disconnect using CapabilityApi - Wear OS Software and Hacking General

In developing my wear watch faces I like to have the wearable vibrate when it detects connection of disconnection from the mobile. In the past I've implemented NodeApi.NodeListener and done the vibration in the onPeerConnect or onPeerDisconnect methods.
This has worked well but NodeApi has be deprecated in favor of the CapabilityApi.
Does anyone know of any simple example of how to detect connection using the CapabilityApi? None of the examples I've tried have worked at all. It should be fairly simple since I'm not trying to do downloads or anything, just detecting.
Thanks.

dlbarron said:
In developing my wear watch faces I like to have the wearable vibrate when it detects connection of disconnection from the mobile. In the past I've implemented NodeApi.NodeListener and done the vibration in the onPeerConnect or onPeerDisconnect methods.
This has worked well but NodeApi has be deprecated in favor of the CapabilityApi.
Does anyone know of any simple example of how to detect connection using the CapabilityApi? None of the examples I've tried have worked at all. It should be fairly simple since I'm not trying to do downloads or anything, just detecting.
Thanks.
Click to expand...
Click to collapse
Did you checked this http://stackoverflow.com/questions/35136881/cant-detect-node-using-the-capability-api ?

Skin1980 said:
Did you checked this http://stackoverflow.com/questions/35136881/cant-detect-node-using-the-capability-api ?
Click to expand...
Click to collapse
Yes, I've seen that one. The code is far from complete, for example, what does that class extend or implement?

Here's what I've done.
This is the entry in the manifest for the service.
<service
android:name=".MyService">
<intent-filter>
<action android:name="com.google.android.gms.wearable.DATA_CHANGED" />
<action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />
<action android:name="com.google.android.gms.wearable.CAPABILITY_CHANGED" />
<action android:name="com.google.android.gms.wearable.CHANNEL_EVENT" />
</intent-filter>
</service>
And here is the code that is supposed to run
public class MyService extends WearableListenerService implements GoogleApiClient.ConnectionCallbacks,GoogleApiClient.OnConnectionFailedListener {
private GoogleApiClient mGoogleApiClient;
private static final String TAG="MyService";
public static final long VIBRATE_TIME = 250;
@override
public void onCreate() {
super.onCreate();
Toast.makeText(this,"Starting onCreate",Toast.LENGTH_LONG).show();
Log.i(TAG,"Starting onCreate");
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
ConnectionResult connectionResult = mGoogleApiClient.blockingConnect(30, TimeUnit.SECONDS);
if(!connectionResult.isSuccess()) {
Toast.makeText(this,"onCreate",Toast.LENGTH_LONG).show();
Log.i(TAG,"onCreate");
}
}
I've overridden the other methods in WearableListenerService but it doesn't matter, the onCreate isn't even called so there's no way the GoogleApiClient is ever created. Now according to what I've read I shouldn't have to do anything to start the service, it is supposed to be started in response to events, like connecting etc, but nothing.

Well, I found the solutions. I created a java class that extends WearableListenerService and in it I override the onPeerConnected and onPeerDisconnected methods. But I also had to add this to the wearable manifest:
<service
android:name=".WearListener">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER"/>
</intent-filter>
</service>
This is odd because BIND_LISTENER is deprecated. But it works so that's all I care about.

Related

[APP] [18 November] [RC1] Energy XDA_UC Configuration Tools 2 (EXCT2)

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This thread is for the discussion, development and support of EXCT2. EXCT2 is compatible with all Energy Roms based on Windows mobile 6.5 and it is entirely possible that it will work with other stock and custom windows mobile roms.​
EXCT2 is the continuation of a project i started last year which can be found here. It was born out of a hatred for the hours it took to configure a new rom install.​
EXCT2 expands on EXCT by adding a basic User Interface and allowing for a large amount of automation for settings gathering from the system registry. No registry editors required, no Third party XML file writers needed. EXCT2 will detect exchange server settings, audio manager storage paths, Windows Live and palringo settings and so much more all at the touch of a button and export them in the appropriate file type in the folder of your choosing for XDA_UC (or possibly Sashimi) to import.​
Requirements:​
Windows Mobile 6.5 or 6.5.x (it may work with 6.0 and 6.1 as well but this has only been tested in the SDK's emulator and may not work as expected)
.Net Compact Framework 3.5
XDA_UC (it may well work with other settings importers like sashimi)
Some patience ​
Known Bugs:​
All known Bugs have been squished for now​
Download:​
All downloads will be hosted here and new builds will also be hosted on XDA. Hosting the newest version anywhere else is strictly prohibited and if you want to host mirrors of previous versions seek my permission first.​
Some Fun Stuff​
I have had some forum banners made up so the users can identify themselves to each other. Also so it is easier to identify the testers and myself outside of this thread. If anyone donates towards the continuation of the project you will get a special supporters banner. Below is the users banner for you to download. Thanks to Swiss420 for creating them and also for doing the program icon. Swis has also just come up with the EXCT2 Splat!​
​
The Thank you's
Finally i should say thank you to a few people simply because they have put up with me pestering them with questions and because they have provided code. These people are XDA members Ultrashot, Stephj, Xcaliburinhand. Also Jesse Jiang and Reed Kimble the on MSDN forums have contributed greatly. Finally The testing team deserve a big thanks (even the guys that went MIA) CanjunFlavoredBob deserves the biggest thanks for sticking with it and providing some great suggestions and ideas.​
The Changelog
Changelog:
18 November (RC1)
Updated Visual look
Other minor bug fixes
23 September (Beta 5)
Added CHT export (hidden and disabled till the CHTE team sort out a bug in their code)
Fixed Minor issue with twitter export
Added People tab order export
Added Manilla Tab order export
Fixed issue with Alarm 2 and alarm3 exports
15 August (Beta 4)
Added Alarm export functions
Some small UI tweaks
Improved Operation Complete and Operation Failed dialogs
Other small tweaks and fixes
24 July (Beta 3.1)
Fixed Rhodium crash (thanks to JVH3)
22 July 2011 (beta 3)
Complete UI redesign.
Added File overwrite checking
Adjusted Time elapsed check in file write success check to 10 seconds
Improved Exception handling
Added "Export all" click detection to reduce the amount of message boxes it generates
Updated xml export code to include updated error handling, file overwrite protection and Export all click detection
Added copy.mscr to cab file (Installs to "\Storage Card\XDA_UC")
Added copy2root folder detection/creation code
Various Other internal changes
10 July 2011 (beta 2):
Fixed xml file write checking code
Improved folderbrowser (thanks to stephj)
Improved combobox item description for all xml functions
Fixed Twitter function (thanks to CJB for helping with that)
Added framework for file copies. Will allow for opera settings export later
Added some basic exception handling
probably some other things i forgot to write down
30 June 2011 (beta 1):
First public release
The FAQ
1) Some misconceptions.
It has been reported this is a settings importer as well as an exporter. This is not true. EXCT2 will only export settings and only the settings it is aware of. It is also not exclusively written for the Energy roms. It will quite probably work on any rom but the only roms it has been tested with are the stock WM6.5 rom in the WM emulator and the Energy rom in my signature. I also know that CajunFlavoredBob uses EXCT2 on his own private custom rom
2) I use a program/feature in Windows Mobile that doesn't have a settings exporter in EXCT2.
Well tell me about it. As long as it is a program that many people use, IS NOT a third party app like S2U2 or any of the SPB programs etc, and you can provide me an complete example of the settings that need to be exported i will work on including it, if it is reasonable to do so.
3) EXCT2 beta 2 and newer crashes on startup
Make sure you have .Net 3.5 Compact framework installed. This can be checked by running cgacutil.exe from the windows folder on the device
4) What do i need to include when posting a problem?
When posting a problem, please include what device you are using, the exact version (including skin, windows build number and rom date) also the version of .Net you have installed. This can be found by running cgacutil.exe from the windows folder on the device. If this util reports anything less than 3.5.xxxx.xx then don't post. Instead grab .Net 3.5 from the MS download center and get NRGZ to update his rom
more to come.........
@everyone This is a pretty handy application that makes exporting settings a piece of cake. Not everything is fully functional yet, but this has HUGE potential for the entire community and deserves some support and recognition.
@M3PH Is the public beta release any different than the last alpha build I tested?
cajunflavoredbob said:
@everyone This is a pretty handy application that makes exporting settings a piece of cake. Not everything is fully functional yet, but this has HUGE potential for the entire community and deserves some support and recognition.
@M3PH Is the public beta release any different than the last alpha build I tested?
Click to expand...
Click to collapse
Yeah i fixed the things you said were broken .. well the things i could fix (the palringo function mostly). I've also spent a little time this afternoon working on the user selectable save location with stephj and we've cracked it so i'll ship that out into a new private area for the testers tomorrow because i'm gonna go have some chill time. I've been working on this for 4 weeks or so and now it's public i'm gonna go enjoy myself for few hours
I've also just sent a PM to ezthunder in the hope that he will come read the thread and post something about it on the portal. I hope he likes EXCT.
M3PH said:
Yeah i fixed the things you said were broken .. well the things i could fix (the palringo function mostly). I've also spent a little time this afternoon working on the user selectable save location with stephj and we've cracked it so i'll ship that out into a new private area for the testers tomorrow because i'm gonna go have some chill time. I've been working on this for 4 weeks or so and now it's public i'm gonna go enjoy myself for few hours
I've also just sent a PM to ezthunder in the hope that he will come read the thread and post something about it on the portal. I hope he likes EXCT.
Click to expand...
Click to collapse
He's a good one to contact. I always go through orb3000. Either way, here's hoping for some exposure.
Have yourself a beer for this little milestone.
cajunflavoredbob said:
He's a good one to contact. I always go through orb3000. Either way, here's hoping for some exposure.
Have yourself a beer for this little milestone.
Click to expand...
Click to collapse
I already am and theres gonna be a few more consumed before the evening is done
Just a couple of things for people reading this thread and thinking is it worth a try. Firstly hell yes! The more feedback i get from the curious the better because it will allow me to improve on the rough edges. I always release stuff as quickly as i can because the more people that use stuff like this the more it improves in a shorter amount of time. Secondly, if you have flashed more than just a couple of custom roms in your time you know it can be a pain to restore all your settings by hand. I remember when i was flashing updates every couple of days. It made using my phone so difficult because everytime i ran a new program i'd have to configure it. After every flash i would have go through the labourious process of reconfiguring my wifi, exchange partner and vpn settings. That's a half hour job right there and with EXCT it takes 10 seconds. Those numbers work for me and the 1500+ people that downloaded the original EXCT.
So go on, try it out, click that thanks button like you have a muscle spasm in your index finger and enjoy the brilliance that is EXCT2 (and if you really like it buy me a beer links below )
so we made it on to the portal see what egzthunder1 had to say here
Can't wait to try it, just need to know what prep is needed. I'm coming from EXCT1, so should I do anything more than backup and empty my XDA_UC folder and then run the cab?
BerMM said:
Can't wait to try it, just need to know what prep is needed. I'm coming from EXCT1, so should I do anything more than backup and empty my XDA_UC folder and then run the cab?
Click to expand...
Click to collapse
BerMM, Whazzzup!!!?
You actually need to interact with this (sorry if that sounds insulting. I've been drinking). For you, i would say all you need to do is make sure the exchange, wifi and vpn tabs are filled out and hit the export all button and prey it's doesn't crash (no exception handling in the public release yet). If it works fine you then you just need to check everything you need was exported and combine the back up with it.
There also stuff in EXCT2 that would have never got into EXCT (like Facebook and twitter settings backup). Mainly because NRGZ said he would include EXCT2 in the rom when it was up to his standards (and the sun, moon, most of the planets and the man himself all align ).
Anyway, nice to see you're still around. I never forget a pretty face... i mean... i never forget a decent supporter
P.S
If you want a copy of the testing version let me know but it means you will have to do some work and stay in touch but you do get a cool banner like CajunBob's (ok fair enough, it's not exactly a massive selling point but Swiss spent time on those)
Going to give this a shot. Watching Nrgz postings shows he is getting ready to release his first 29022 ROM tonight so this will come in handing getting all the apps configured like I want them.
Thanks.
6700Freak said:
Going to give this a shot. Watching Nrgz postings shows he is getting ready to release his first 29022 ROM tonight so this will come in handing getting all the apps configured like I want them.
Thanks.
Click to expand...
Click to collapse
Another rom, you say? Any chance someone could tell me where a changelog is for these different builds (29017 vs 29022 for example)?
back to the main subject: Great job! I haven't "export[ed] all' yet, as I don't use sense and I feared for the safety of my meticulously kept xda_uc folder, but everything I tested worked just fine.
My first suggestion would be the obvious; instead of having numbers for encryption/auth in the wifi tab, make the drop down list show the words each number represents.
I haven't HR'd yet, but looking at the Hotmail.reg, it doesn't seem to have saved the password anywhere, encrypted or not.
Additionally, it would be nice for it to have an option to add other mail accounts with a page similar to what you have for exchange.
link68759 said:
Another rom, you say? Any chance someone could tell me where a changelog is for these different builds (29017 vs 29022 for example)?
back to the main subject: Great job! I haven't "export[ed] all' yet, as I don't use sense and I feared for the safety of my meticulously kept xda_uc folder, but everything I tested worked just fine.
My first suggestion would be the obvious; instead of having numbers for encryption/auth in the wifi tab, make the drop down list show the words each number represents.
I haven't HR'd yet, but looking at the Hotmail.reg, it doesn't seem to have saved the password anywhere, encrypted or not.
Additionally, it would be nice for it to have an option to add other mail accounts with a page similar to what you have for exchange.
Click to expand...
Click to collapse
You can't lift the hotmail password from the registry. It's just plain impossible but you can lift everything else so when you run windows live all you have to do is to enter the password. There is also no provision for placing it in to a registry file so windows live knows what to do with it. So blame MS not me.
The numbers will get masked eventually. Right now it's more of a case of getting everything working before we make it look nice (and if you look at post 3 there are links that explain the numbers)
If you want extra email accounts send me an example file and when i get time i'll make up a layout and some code for it.
You guys have to understand that to write a program like this i've had to do months of reaserch to get the registry keys etc for exct1 and then i've had to learn VB, develop exchange partner detection code (i am the only person in the world to have done that) and then write 1100+ lines and counting of code. I can also only develop for what i have to hand. If i don't have say a yahoo email account syncing to my phone i'm not just magic one up to test with
M3PH said:
You can't lift the hotmail password from the registry. It's just plain impossible but you can lift everything else so when you run windows live all you have to do is to enter the password. There is also no provision for placing it in to a registry file so windows live knows what to do with it. So blame MS not me.
The numbers will get masked eventually. Right now it's more of a case of getting everything working before we make it look nice (and if you look at post 3 there are links that explain the numbers)
If you want extra email accounts send me an example file and when i get time i'll make up a layout and some code for it.
You guys have to understand that to write a program like this i've had to do months of reaserch to get the registry keys etc for exct1 and then i've had to learn VB, develop exchange partner detection code (i am the only person in the world to have done that) and then write 1100+ lines and counting of code. I can also only develop for what i have to hand. If i don't have say a yahoo email account syncing to my phone i'm not just magic one up to test with
Click to expand...
Click to collapse
I won't blame microsoft for protecting my passwords
I appreciate the significant amount of work you've put into your projects; but correct me if I'm wrong, generating the email2.xml could be done in almost exactly the same way as you have with the activesync page. You don't need to test any email accounts, since if it doesn't work AND the xml file was generated correctly, that is beyond the scope of this export project (and probably something funky going on within winmo itself, since xda_uc is only the messenger). Regardless, I would be willing to create any number of email accounts to help testing, and I'm sure others with random email domains will offer up their bug reports.
I will post a sample email2.xml later
------EDIT
It's later, here's a generic imap email config. There's probably some unnecessary unused values at the end, and I don't mean to patronize, but have you read http://msdn.microsoft.com/en-gb/bb737579 ?
Code:
<wap-provisioningdoc><characteristic type="EMAIL2">
<characteristic type="{76877040-0395-4efb-b3c6-b87c5aedce67}">
<parm name="SERVICENAME" value="Gmail" />
<parm name="SERVICETYPE" value="IMAP4" />
<parm name="INSERVER" value="imap.gmail.com" />
<parm name="OUTSERVER" value="smtp.gmail.com" />
<parm name="NAME" value="Link" />
<parm name="AUTHNAME" value="[email protected]" />
<parm name="AUTHSECRET" value="supersafepass" />
<parm name="DOMAIN" value="" />
<parm name="REPLYADDR" value="[email protected]" />
<parm name="FORMAT" value="2" />
<parm name="LINGER" value="30" />
<parm name="RETRIEVE" value="-1" />
<parm name="KEEPMAX" value="50" />
<parm name="DWNDAY" value="7" />
<characteristic type="TAGPROPS">
<parm name="8128000B" value="0"/>
<parm name="812C000B" value="1"/>
</characteristic>
<parm name="AUTHREQUIRED" value="1" />
<parm name="SMTPALTENABLED" value="0" />
<parm name="SMTPALTAUTHNAME" value="" />
<parm name="SMTPALTAUTHPASSWORD" value="" />
<parm name="SMTPALTDOMAIN" value="" />
</characteristic>
</characteristic>
</wap-provisioningdoc>
link68759 said:
I won't blame microsoft for protecting my passwords
I appreciate the significant amount of work you've put into your projects; but correct me if I'm wrong, generating the email2.xml could be done in almost exactly the same way as you have with the activesync page. You don't need to test any email accounts, since if it doesn't work AND the xml file was generated correctly, that is beyond the scope of this export project (and probably something funky going on within winmo itself, since xda_uc is only the messenger). Regardless, I would be willing to create any number of email accounts to help testing, and I'm sure others with random email domains will offer up their bug reports.
I will post a sample email2.xml later
------EDIT
It's later, here's a generic imap email config. There's probably some unnecessary unused values at the end, and I don't mean to patronize, but have you read http://msdn.microsoft.com/en-gb/bb737579 ?
Code:
<wap-provisioningdoc><characteristic type="EMAIL2">
<characteristic type="{76877040-0395-4efb-b3c6-b87c5aedce67}">
<parm name="SERVICENAME" value="Gmail" />
<parm name="SERVICETYPE" value="IMAP4" />
<parm name="INSERVER" value="imap.gmail.com" />
<parm name="OUTSERVER" value="smtp.gmail.com" />
<parm name="NAME" value="Link" />
<parm name="AUTHNAME" value="[email protected]" />
<parm name="AUTHSECRET" value="supersafepass" />
<parm name="DOMAIN" value="" />
<parm name="REPLYADDR" value="[email protected]" />
<parm name="FORMAT" value="2" />
<parm name="LINGER" value="30" />
<parm name="RETRIEVE" value="-1" />
<parm name="KEEPMAX" value="50" />
<parm name="DWNDAY" value="7" />
<characteristic type="TAGPROPS">
<parm name="8128000B" value="0"/>
<parm name="812C000B" value="1"/>
</characteristic>
<parm name="AUTHREQUIRED" value="1" />
<parm name="SMTPALTENABLED" value="0" />
<parm name="SMTPALTAUTHNAME" value="" />
<parm name="SMTPALTAUTHPASSWORD" value="" />
<parm name="SMTPALTDOMAIN" value="" />
</characteristic>
</characteristic>
</wap-provisioningdoc>
Click to expand...
Click to collapse
Cool, thanks. Can i be cheeky and as you to export the registry key for that too?
As for the coding, it is pretty similar but the problem is in the details. Although the xml writing code would be the same with out the above file i'd have no idea what the attributenames would need to be. Then there is digging the values from the registry. You need to know the name of the account and every one names them differently. So you need to have an inputbox so the user can enter the name, then you need to run a search through the registry to find the relevent key and finally convert all the registry values to something that can be used in an xml file. So, if the email2 providers aren't grouped together in the registry like the activesync partners that's gonna mean writing a custom search proceedure.
So you see how complicated it is and yes i had read that link but it doesn't tell me the things i need to know about the registry key's and values because you forget this program is supposed to be as autonomous as possible and just another xml file writer.
Right, and now for a progress update. The current testing version has an improved folderbrowser that now supports a hierarchal view. Also, i have implemented some very basic exception handling. I expect to get the new version to you guys this week but i'm not making an promises.
Ok, I see, I didn't realize the activesync page fetches values from the registry. I didn't use it, and from my glance at it, I thought you had to fill in the values yourself (which is what I thought would be done for the email2.xml).
I'll have the key for you shortly.
link68759 said:
Ok, I see, I didn't realize the activesync page fetches values from the registry. I didn't use it, and from my glance at it, I thought you had to fill in the values yourself (which is what I thought would be done for the email2.xml).
I'll have the key for you shortly.
Click to expand...
Click to collapse
Some of it comes from the registry and some of it you have to enter coz it's easier to get the user to input it than convert the value data to something the xml file can use. Ideally i would prefer it if the user never had to enter anything but that perfect world doesn't exist
The Beta2 has gone to the testing team. I'm hoping they do their thing so i can get it out today but it's very much a case of it's ready when it's ready. The preliminary changelog includes lots of crash fixes and some bug squishing and a speed improvement here and there. I also have a surprise for you but i'll keep that one quiet untill we release Beta2. Let's just say it opens the door for some really cool future features.
Also would you guys like it if i posted future versions on xda as well as hotfile so you can use the new QR Code download system? Post below and tell me what you think
I can't find the registry keys of email accounts for the life of me: where are they located?
link68759 said:
I can't find the registry keys of email accounts for the life of me: where are they located?
Click to expand...
Click to collapse
It will either be "\storage card" or "\storage card\XDA_UC" and is called either exchange.xml or hotmail.reg. It won't be anywhere else. In the testing version i implemented a folder browser so you can pick where it is saved.

Intercept/block outgoing sms (using root)

Hi, I want to create an application which intercepts sent sms and shows a dialog eventually performing certain actions before allowing the message to be sent. It's pretty much like "LBE Privacy Guard", but with a different purpose.
Does anybody know how can I catch sms being sent using root and a background service? I have looked on the internet but without success.
Thanks!
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Moving to Q&A
All I could find was on stackoverflow, but it's functionality is limited to the stock application and perhaps a few more. It doesn't use root.
Code:
<intent-filter>
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
</intent-filter>
This doesn't intercept applications that use SmsManager directly, and maybe not even then.
The default SMS Application uses android.telephony.SmsManager's method SendDataMessage() that doesn't send any broadcast.
Click to expand...
Click to collapse
http://stackoverflow.com/questions/5808577/android-listen-outgoing-sms-or-sent-box
http://stackoverflow.com/questions/8171783/how-to-do-outgoing-sms-interception-using-ndk
Nobody knows anything? Not even using root?

[Q] HTC Explorer android.net.sip support for developing apps

Can anyone please tell me if the phone HTC Explorer(HTC Explorer Product Overview - HTC Smartphones) allows the use of the android.net.sip API. What I mean is, will writing an application using that API work out of the box on that phone, without having to root the phone or modify android OS system files?
If anyone has this phone and would be kind enough to try a demo application like SipDemo or better yet try calling the static methods isApiSupported and isVoipSupported of the SipManager class to see if the API can be accessed, I would appreciate it very much.
To spare you some time, this is an activity that logs if the API is accessible or not:
Code:
package voip.test;
import android.app.Activity;
import android.net.sip.SipManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
public class SipTestActivity extends Activity {
private static final String TAG = "voip_test";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
if (SipManager.isApiSupported(this) && SipManager.isVoipSupported(this)) {
Log.d(TAG, "supported");
Toast.makeText(this, "supported", Toast.LENGTH_LONG).show();
} else {
Log.d(TAG, "not supported");
Toast.makeText(this, "not supported", Toast.LENGTH_LONG).show();
}
}
}
I have also attached a zip archive containing a self-signed application that uses the previous activity code and when run, logs and toasts the status of the API.
Any help with this, would be much appreciated! Thanks
heartbyte101 said:
Can anyone please tell me if the phone HTC Explorer(HTC Explorer Product Overview - HTC Smartphones) allows the use of the android.net.sip API. What I mean is, will writing an application using that API work out of the box on that phone, without having to root the phone or modify android OS system files?
If anyone has this phone and would be kind enough to try a demo application like SipDemo or better yet try calling the static methods isApiSupported and isVoipSupported of the SipManager class to see if the API can be accessed, I would appreciate it very much.
To spare you some time, this is an activity that logs if the API is accessible or not:
Code:
package voip.test;
import android.app.Activity;
import android.net.sip.SipManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
public class SipTestActivity extends Activity {
private static final String TAG = "voip_test";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
if (SipManager.isApiSupported(this) && SipManager.isVoipSupported(this)) {
Log.d(TAG, "supported");
Toast.makeText(this, "supported", Toast.LENGTH_LONG).show();
} else {
Log.d(TAG, "not supported");
Toast.makeText(this, "not supported", Toast.LENGTH_LONG).show();
}
}
}
I have also attached a zip archive containing a self-signed application that uses the previous activity code and when run, logs and toasts the status of the API.
Any help with this, would be much appreciated! Thanks
Click to expand...
Click to collapse
My phone says " Hello world, SipTestActivity".:beer:
From a HTC Explorer A310e using XDA.
Sent from a person who likes people pressing the thanks button.
ri123 said:
My phone says " Hello world, SipTestActivity".:beer:
From a HTC Explorer A310e using XDA.
Sent from a person who likes people pressing the thanks button.
Click to expand...
Click to collapse
My phone is rooted, although, sorry:thumbdown:
From a HTC Explorer A310e using XDA.
Sent from a person who likes people pressing the thanks button.
Thankyou very much for you answer, ri123, but I am looking to see if the API is available on non-rooted phones.
PS: when starting the application I attached, there should be a small toast message for a couple of seconds, near the bottom of the screen displaying either "supported" or "not supported", it is curious that you did not see it...I don't see anything wrong with the code, and it works on the emulator just fine.
But thanks anyway! Still searching for an answer to this question though...
ri123 said:
My phone is rooted, although, sorry:thumbdown:
From a HTC Explorer A310e using XDA.
Sent from a person who likes people pressing the thanks button.
Click to expand...
Click to collapse
Could you please tell me if, when you ran the SipTest app, it showed you a small Toast message saying "supported" or "not supported" in the lower half of the activity screen, and if so, what the message said?
I am asking you this question, because just acquyring root account on the phone, whithout modyfing files in /system/etc/permissions does not affect the SIP api in any way. So if you did not modify/add android.net.sip permission files in /system/etc/permissions after rooting, and now SipTest returns the "supported" message on the screen, then it should have also been accessible before rooting it.
I hope I phrased my question in an undertandable way. Please help me with answering this question. Thanks in advance, heartbyte101
heartbyte101 said:
Could you please tell me if, when you ran the SipTest app, it showed you a small Toast message saying "supported" or "not supported" in the lower half of the activity screen, and if so, what the message said?
I am asking you this question, because just acquyring root account on the phone, whithout modyfing files in /system/etc/permissions does not affect the SIP api in any way. So if you did not modify/add android.net.sip permission files in /system/etc/permissions after rooting, and now SipTest returns the "supported" message on the screen, then it should have also been accessible before rooting it.
I hope I phrased my question in an undertandable way. Please help me with answering this question. Thanks in advance, heartbyte101
Click to expand...
Click to collapse
There was a message saying "supported".
From a HTC Explorer A310e using XDA.
Sent from a person who likes people pressing the thanks button.
ri123 said:
There was a message saying "supported".
From a HTC Explorer A310e using XDA.
Sent from a person who likes people pressing the thanks button.
Click to expand...
Click to collapse
Thankyou for your help, ri123, I guess then the answer to my question should be YES, the API is available to develop applications.
If anyone else has some information regarding my question, or has used this device to develop apps and could shed some light on the status of the android.net.sip API on this device, please share, any additional information would help.
Thanks

[Q] Libgdx and Admob

Hello everybody,
I am a new developer and started with Libgdx to make a simple game (Flappy Bird) an understand everything.
My English is not the best but I could understand this tutorial (tutorial) and make my "own" Flappy Bird.
To complete the tutorial I wanted to show some ads in the app but it didn't work. I used the ads from admob.
Can someone explain me how I can show ads? I think libgdx is the problem but I don't know what I did wrong.
I found this code but it doesn't work and I am getting a few errors: (Is ist correct and am I right if I do in the Android folder a new class
called BannerExample and put this code in it?
import com.google.ads.*;
public class BannerExample extends Activity {
private AdView adView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Create the adView
adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID);
// Lookup your LinearLayout assuming it's been given
// the attribute android:id="@+id/mainLayout"
LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());
}
@Override
public void onDestroy() {
if (adView != null) {
adView.destroy();
}
super.onDestroy();
}
}
Click to expand...
Click to collapse
PS: Sorry for my bad English!
libGDX and AdMob
Hi,
which error messages do you get?
Which Version of libGDX do you use?
I'm not sure if it's possible make it with a class like your BannerExample.
For my app I put all the code for the ad in the AndroidLauncher class.
Additionally you should update to Google Mobile Ads because Google will stop the support of the old standalone sdk.
I think this will help you:
The Article "Google Mobile Ads in Libgdx (replaces deprecated AdMob)" in the libGDX Wiki on github.
And a sample code from "TheInvader360" on github.
I hope you find the right sites. I can't post links .
Good luck

Why is Google Play saying certain devices are incompatible with my app?

I've recently just launched my app, and it's going really well! I am having issues with some users, though. Users on older devices such as the Nexus 5X, Huawei P10 Lite, and Meizu M2 Note are saying they are unable to download the app on Google Play because it say it is incompatible with their device. I've already checked the Developer Console and it says the app should support these devices (except the Meizu that one doesn't even show up in the catalog). I've also emulated some of the devices with issues and not had any problems with compatibility.
I've been looking all over google for a way to solve this, but honestly I have no idea what to do anymore. This is my first real app and I can't help but get the feeling that I'm missing some crucial step for widespread release.
________________
Here's my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="removed because links"
package="com.balanstudios.einar.workouttimer">
<uses-permission android:name="android.permission.VIBRATE" />
<uses-feature android:name="android.hardware.vibrate" android:required="false"></uses-feature> <--- added this in after getting reports about issues
<application
android:name=".BaseApp"
android:allowBackup="true"
android:icon="@mipmap/ic_work_icon_small"
android:label="Robota"
android:roundIcon="@mipmap/ic_work_icon_small_round"
android:supportsRtl="true"
android:theme="@style/WorkoutTimerLight">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="@style/WorkoutTimerLight"
android:windowSoftInputMode="adjustPan">
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
<activity android:name=".SplashScreen"
android:screenOrientation="portrait"
android:theme="@style/WorkoutTimerLight"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
</application>
</manifest>
Here's my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.balanstudios.einar.workouttimer"
minSdkVersion 23
targetSdkVersion 28
versionCode 7
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:support-media-compat:28.0.0-alpha3'
implementation 'com.android.support:design:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:28.0.0-alpha3'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
________________
Does anyone have any ideas? I would really appreciate any help!
Unfortunately, I can't post a link to the app as I'm a new member (but long time lurker), but if you search Robota Intervals on Google Play should you be able to find it.
AYEEStooby said:
I've recently just launched my app, and it's going really well! I am having issues with some users, though......
Click to expand...
Click to collapse
Though the following links may be a bit older, they should be helpful for what you are looking for.
https://stackoverflow.com/questions...my-android-app-is-incompatible-with-my-own-de
https://stackoverflow.com/questions/14020237/android-app-is-supported-by-0-devices/14020303#14020303
There's a number of other factors that has to be considered when this happens.
Those links above has various different ways many others have resolved this issue.
It's really difficult to explain the whole thing to you which is why those are just some helpers for you to determine the best course of action.
Good Luck!
Sent from my SM-G900V using The ClaRetoX Forum App

Categories

Resources