Can anyone help me with any sdk for implementing ads in kivy app.
Revmobs have stopped supporting Kivy.
Any other method of implementing ads would also work.
Thanks
I have had success with AdBuddiz via jnius, I guess that you can use any java SDK on android this way:
PythonActivity=autoclass("org.renpy.android.PythonActivity")
AdBuddiz=autoclass("com.purplebrain.adbuddiz.sdk.AdBuddiz")
AD_CHANCE = 0.06
def init():
AdBuddiz.setPublisherKey("YOUR SECRET KEY .... ")
#delete this before going to play at the store...
AdBuddiz.setTestModeActive()
AdBuddiz.cacheAds(PythonActivity.mActivity)
def show():
if (random.random() < AD_CHANCE):
log.info("Showing Ad!!!")
try:
AdBuddiz.showAd(PythonActivity.mActivity)
except Exception:
log.exception("Pizza is not healthy...")
else:
log.warn("Skipping the AD this time ;)")
I guess that on iOS you can use PyObjC to achieve the same results...
Related
I have integrated wahoo api in iOS. I need to get WFHeartrateData for WFFitnessEquipmentConnection.
But not able to test without real adaptor. Is there any way i can test using iPhone device or other way?
Please find the below work in progress code implementation:
Add parameter WF_SENSORTYPE_FITNESS_EQUIPMENT for startDiscovery and implement WFFitnessEquipmentConnection (FE-C).
Create a new object for WFFitnessEquipmentConnection and make connection to sensor using below method:
requestSensorConnection:deviceParams withProximity:WF_PROXIMITY_RANGE_DISABLED error:&error
Tried to get the data WFFitnessEquipmentData and WFFitnessEquipmentRawData from fitness equipment connection.
WFFitnessEquipmentData* hrData = [self.fitnessEquipmentConnection getFitnessEquipmentData];
WFFitnessEquipmentRawData* hrRawData = [self.fitnessEquipmentConnection getFitnessEquipmentRawData];
I have a bunch of buttons that opens the default map application and puts something in the users system clipboard. It works fine on Android tablets, but the Iphone does nothing when the button is clicked. Here is the code:
case "MapYummyYummy":
System.setClipboard( "1665 Stelton Rd Piscataway Nj 08901" )
_callURL = "geo: 40.4978922, -74.4488224";
var targetURL:URLRequest = new URLRequest(_callURL);
navigateToURL(targetURL);
break;
Does anyone know the equivalent for this that will work on Iphone devices? thanks!
Have you tried this setData method? (I have no experience with this one, but looks like a viable alternative).
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/Clipboard.html#setData()
iOS launch maps via URL reference:
http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/MapLinks.html
Querying for a location:
http://maps.apple.com/?q=cupertino
setting a start and end for directions:
http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=cupertino
Hope it works for ya (looked up not tested).
I have started developing html applications for mutliple platforms. I recently heard about Cordova 2.0(PhoneGap) and ever since I have been curious to know how the bridge works.
After lot of code walking, i saw that the Exec.js is the code where call from JS -> Native happens
execXhr = execXhr || new XMLHttpRequest();
// Changeing this to a GET will make the XHR reach the URIProtocol on 4.2.
// For some reason it still doesn't work though...
execXhr.open('HEAD', "file:///!gap_exec", true);
execXhr.setRequestHeader('vc', cordova.iOSVCAddr);
if (shouldBundleCommandJson()) {
execXhr.setRequestHeader('cmds', nativecomm());
}
execXhr.send(null);
} else {
execIframe = execIframe || createExecIframe();
execIframe.src = "gap://ready";
But want to understand how that works, what is the concept here, what does file:///!gap_exec or gap://ready do? and how does the call propgate to the lower layers (native code layers)
thanks a bunch in advance.
The trick is easy:
There is a webview. This displays your app. The webview will handle all navigation events.
If the browser navigates to:
file:///!gap_exec
or
gap://
the webview will cancel the navigation. Everything behind these strings is re-used as an identifier, to get the concrete plugin/plugin-method and parameter:
pseudo-url example:
gap://echoplugin/echothistext?Hello World
This will cause phonegap to look for an echoplugin and call the echothistext method to send the text "Hello World" to the (native) plugin.
update
The way back from native to javascript is (or may be) loading a javascript: url into the webview.
The concrete implementation is a little bit more complex, because the javascript has to send a callback-id to native code. There could be more than one native call are running at the same time. But in fact this is no magic at all. Just a number to get the correct JSON to the right javascript-callback.
There are different ways to communicate between the platform and javascript. For Android there are three or four different bridges.
I am trying to figure this out in more detail, too. Basically there are 2 Methods on the iOS side that can help ...
- webView:shouldStartLoadWithRequest:navigationType: and
- stringByEvaluatingJavaScriptFromString:script
From the sources it seems cordova sends a "READY" message using webView:shouldStartLoadWithRequest:... and then picks up results with the second message, but I am not sure.
Cordova Sources iOSExec
There is much to learn there.
I have this posted on PhoneGap google groups and cross-posted it here on Stack Overflow.
Anyway, PhoneGap's Contact API is giving me headache lately. To cut it short:
Environment
iOS 6
PhoneGap 2.0.0
I have this application that scans a QR code with VCard embeded, and it will save it into user's contact once the user agree to save it down. On Android 4.1.2, this piece of code works flawlessly without any error, and contact was saved too. On iOS 6, however, I can't get it to work. What I have always receive is error #4, which is, ContactError.IO_ERROR.
The code is as below:
navigator.notification.confirm('Found a contact: "'+(vcard['N'] || '')+'". Add it into your contact list?', function(btn) {
if (btn == 1) {
var contact = navigator.contacts.create();
contact.displayName = vcard['N'] || '';
contact.emails = [new ContactField('email', vcard['EMAIL'] || '')];
var org = new ContactOrganization();
org.name = vcard['ORG'] || '';
contact.organizations = [org];
contact.save(function() {
navigator.notification.alert('Contact Saved');
}, function(err) {
navigator.notification.alert('Error on saving contact: '+err.code);
});
}
}, 'QR Code Scanner', 'OK,Cancel');
And below is the only log I have seen on XCode right after I tap on 'OK': (first callback is for the notification.confirm)
2012-10-22 21:19:24.619 [11897:907] PluginResult:toJSONString - {"status":1,"message":1,"keepCallback":false}
2012-10-22 21:19:24.621 [11897:907] PluginResult toSuccessCallbackString: cordova.callbackSuccess('Notification12',{"status":1,"message":1,"keepCallback":false});
2012-10-22 21:19:24.738 [11897:907] PluginResult:toJSONString - {"status":9,"message":4,"keepCallback":false}
2012-10-22 21:19:24.739 [11897:907] PluginResult toErrorCallbackString: cordova.callbackError('Contacts13',{"status":9,"message":4,"keepCallback":false});
Then I will see the alert:
Error on saving contact: 4
Note
vcard is a key-value pair of vcard obj. Please ignore this for now. It's not important.
This piece of code works fine on android.
Is this the correct way of creating contact? How can you save a contact on iOS 6 using PhoneGap?
Edit
I did all the necessary migration and upgraded to v2.1.0, but the error code still emerges. Why is this?
Edit
Apparently this has something to do with the new AddressBook permissions request on iOS 6 as mentioned by Mark, but no one has answered me on how to do it properly. Spent some times on research I came to a conclusion that it's best if we can just wait for Phonegap to finish up v2.2 as I saw permission request being added in CDVContacts.m in v2.2 rc2 commit 61857860...
https://issues.apache.org/jira/browse/CB-902
Currently crashes if the user does not have AddressBook permission on iOS 6.
The user will get a popup dialog similar to the Geolocation permissions dialog. When creating an address book, we should handle the condition where the app does not have permission, and the address book returned is NULL.
i've had the same problem. As it turns out, i was using phonegap version 1.9, which did not support iOS 6, therefore adding a contact gave me Error 4 message all the time. To fix this, i upgraded to phonegap version 2.1. This version supports iOS 6 as well as both armv6 and armv7 architectures. The error message was because iOS 6 requires permissions to access the address book, in the same way that using the GPS requires permission on iOS. This should solve your problem, it did for me :)
I have integrated the facebook in my app using http://sourceforge.net/projects/facebook-bb-sdk, it work fine in stimulator but when view in device it show me the
http://m.facebook.com/login.php?app_id=0000000000[0.0] 61&cancel=http%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html%3Ferror_reason%3Duser_denied%[0.0] 26error%3Daccess_denied%26error_description%3DThe%2Buse[0.0] r%2Bdenied%2Byour%2Brequest.&fbconnect=1&next=https%3A%2F%2Fm.facebook.com%2Fdialog%2Fpermissions.re[0.0] quest%3F_path%3Dpermissions.request%26app_id%3D175269295861061%26redirect_uri%3Dhttp%253A%252F%252Fw[0.0] ww.facebook.com%252Fconnect%252Flogin_success.html%26di[0.0] splay%3Dwap%26response_type%3Dtoken%26fbconnect%3D1%26perms%3Duser_about_me%252Cuser_activities%252C[0.0] user_birthday%252Cuser_education_history%252Cuser_events%252Cuser_groups%252Cuser_hometown%252Cuser_[0.0] interests%252Cuser_likes%252Cuser_location%252Cuser_not[0.0] es%252Cuser_online_presence%252Cuser_photo_video_tags%252Cuser_photos%252Cuser_relationships%252Cuse[0.0] r_relationship_details%252Cuser_religion_politics%252Cuser_status%252Cuser_videos%252Cuser_website%2[0.0] 52Cuser_work_history%252Cemail%252Cread_friendlists%252[0.0] Cread_insights%252Cread_mailbox%252Cread_requests%252Cread_stream%252Cxmpp_login%252Cads_management%[0.0] 252Cuser_checkins%252Cfriends_about_me%252Cfriends_activities%252Cfriends_birthday%252Cfriends_educa[0.0] tion_history%252Cfriends_events%252Cfriends_groups%252C[0.0] friends_hometown%252Cfriends_interests%252Cfriends_likes%252Cfriends_location%252Cfriends_notes%252C[0.0] friends_online_presence%252Cfriends_photo_video_tags%252Cfriends_photos%252Cfriends_relationships%25[0.0] 2Cfriends_relationship_details%252Cfriends_religion_pol[0.0] itics%252Cfriends_status%252Cfriends_videos%252Cfriends_website%252Cfriends_work_history%252Cmanage_[0.0] friendlists%252Cfriends_checkins%252Cpublish_stream%252Ccreate_event%252Crsvp_event%252Coffline_acce[0.0] ss%252Cpublish_checkins%252Cmanage_pages%252Coffline_ac[0.0] cess%26from_login%3D1&rcount=1&_rdr
I have change the app id in url.
just show me the text in white background.Please let me know if anything else requires.
Thank you
It was issue from network side,i have check with other wi-fi and it was working.
Thank you.