First of all: Thanks that I got such a good and fast feedback from you guys a few days ago.
I'm still playing around in Tabris 0.11 and tried to implement a Geolocation like you guys did in the demo project.
Everything is working great on Android, but under iOS (IPhone 5) I get the error
EXC_BAD_ACCESS (code=1, address=0xbbadbeef)
Here is how my code looks like
public void create( Composite parent, UIContext context ) {
// creation of the layout types
createLayouts();
parent.setLayout( GridLayoutFactory.fillDefaults().margins( 0, 0 ).spacing( 0, 0 ).create() );
createContainer( parent );
createBrowser();
}
private void createLayouts() {
layoutGrid = new GridLayout();
layoutGrid.numColumns = 1;
layoutGridData = new GridData();
layoutGridData.horizontalAlignment = GridData.FILL;
}
private void createContainer( Composite parent ) {
[...]
containerBrowser = new Composite( parent, SWT.NONE );
containerBrowser.setLayout( layoutGrid );
containerBrowser.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
[...]
}
private void createBrowser() {
browser = new Browser( containerBrowser, SWT.NONE );
browser.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
lastLat = 48.775418;
lastLon = 9.181759;
setBrowserUrl( lastLat, lastLon);
}
private void setBrowserUrl( double lat, double lon) {
StringBuilder builder = new StringBuilder();
builder.append( "http://open.mapquestapi.com/staticmap/v4/getmap" );
builder.append( "?size=" + 200 + "," + 200 );
builder.append( "&zoom=16" );
lastLat = lat;
lastLon = lon;
builder.append( "¢er=" + lat + "," + lon );
builder.append( "&imageType=png" );
if( lastLabel != null ) {
builder.append( "&pois=" + lastLabel + "," + lat + "," + lon + ",0,0" );
}
browser.setUrl( builder.toString() );
}
I'm not really experienced in iOS, I hope this information helps you guys.
Thanks in advance, Toby
With the example you've provided, I could not reproduce the problem. Maybe what you are seeing is an issue in the pre-release Tabris 0.11 client. The issue might be already fixed in the final Tabris 1.0 release.
I suggest you download Tabris 1.0 ( http://developer.eclipsesource.com/tabris/downloads/ ) and try again.
If you still have a problem, send my your "Device Log" of the crashed App using the "Xcode Organizer".
Related
i am developing game with Unity3D v5.3.1f1 and Facebook SDK for Unity v7.2.0 for Android + iOS. There are leaderboard within the game that shows scores saved on Facebook, there are also profile picture on it.
code are implemented like this:
// Generate Graph API query for a user/friend's profile picture
public static string GetPictureQuery(string facebookID, int? width = null, int? height = null, string type = null, bool onlyURL = false)
{
string query = string.Format("/{0}/picture", facebookID);
string param = width != null ? "&width=" + width.ToString() : "";
param += height != null ? "&height=" + height.ToString() : "";
param += type != null ? "&type=" + type : "";
if (onlyURL) param += "&redirect=false";
if (param != "") query += ("?g" + param);
return query;
}
string ids = "friend id here";
void loadFBProfilePicture()
{
string query = GraphUtil.GetPictureQuery(ids, 100, 100, "normal");
FB.API(query, HttpMethod.GET, dealWithProfPic);
}
void dealWithProfPic(IGraphResult result)
{
Debug.Log("Callback called!");
if (result.Error != null)
{
return;
}
profpic.sprite = Sprite.Create(result.Texture, new Rect(0, 0, 100, 100), new Vector2(0, 0));
}
Program just need to call loadFBProfilePicture function then the callback function dealWithProfPic will assign the texture to the sprite. This works perfectly on Android & Unity Editor, but not for iOS!
After some debugging, the problem that i found is, the callback is never called. Log message "Callback called" never shows up on the debug window.
Solution that have been tried is upgrading Facebook SDK for Unity to v7.3.0, but still no result.
Additional info: tested on Ipad Air 2 with iOS 9.2
EDIT (25 Jan 2016):
It is already confirmed by facebook that is a bug on this link
I've developed simple project using three.dart framework. It launches and shows web page ok. But after 3-5 seconds it crashes with unknown error. Dart editor and browser don't show the reason why it crashed
Here is a code:
import 'dart:html';
import 'dart:math' as Math;
import 'package:three/three.dart';
class MyClass {
Element container;
PerspectiveCamera camera;
Scene scene;
CanvasRenderer renderer;
Mesh plane;
num targetRotation;
num targetRotationOnMouseDown;
num windowHalfX;
num windowHalfY;
var evtSubscriptions = [];
void run() {
init();
animate(0);
}
void init() {
targetRotation = 0;
targetRotationOnMouseDown = 0;
windowHalfX = window.innerWidth / 2;
windowHalfY = window.innerHeight / 2;
container = new Element.tag('div');
document.body.nodes.add( container );
Element info = new Element.tag('div');
info.style.position = 'absolute';
info.style.top = '10px';
info.style.width = '100%';
info.style.textAlign = 'center';
info.innerHtml = 'Drag to spin the cube';
container.nodes.add( info );
scene = new Scene();
camera = new PerspectiveCamera( 70.0, window.innerWidth / window.innerHeight, 1.0, 1000.0 );
camera.position.y = 150.0;
camera.position.z = 500.0;
scene.add( camera );
// Plane
plane = new Mesh( new PlaneGeometry( 200.0, 200.0 ), null);
scene.add( plane );
renderer = new CanvasRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
container.nodes.add( renderer.domElement );
}
void render() {
renderer.render( scene, camera );
}
animate(num time) {
window.requestAnimationFrame(animate);
render();
}
}
void main() {
new Canvas_Geometry_Cube().run();
}
How to fix a crash?
I found out the problem. It works with Web GL properly (NOT canvas).
Sergio three.dart might need some work to be updated, its been awhile since a latest version was published on pub. Sorry. Please feel free to checkout the latest branch or code review on the https://github.com/threeDart/three.dart site
new to actionscript and looking at the GeolocationEvent.UPDATE examples, having some unexpected results with .appendText() and an array.push --I didn't know whether they might both be just the phone not keeping up with the updates?
first, the text problem is that it's overwriting rather than replacing the last write, so after a couple minutes of the app running on the phone, you can't read the numbers any more. --using this.removeChild() and then addChild() was about trying to get it to remove the last write before writing again.
and then second, the problem with the array is that it's outputting random .length numbers in the trace() --the length looks to occasionally reset to 2 before counting up again, and counts up to seemingly random numbers. I know that I don't want the overhead of an array in the final version, but I'm trying to learn from why it's not working.
I've commented out the different things I've tried --sorry if I've missed something basic here
var format:TextFormat = new TextFormat();
format.color = 0xff0066;
format.font = "Lucida Console";
format.size = 20;
var fl_GeolocationDisplay:TextField = new TextField();
fl_GeolocationDisplay.defaultTextFormat = format;
fl_GeolocationDisplay.x = 10;
fl_GeolocationDisplay.y = 20;
fl_GeolocationDisplay.selectable = false;
fl_GeolocationDisplay.autoSize = TextFieldAutoSize.LEFT;
//fl_GeolocationDisplay.text = "Geolocation is not responding. Verify the device's location settings.";
fl_GeolocationDisplay.text = " ";
addChild(fl_GeolocationDisplay);
var gpsArray:Array = [42.09646417];
if(!Geolocation.isSupported)
{
fl_GeolocationDisplay.text = "Geolocation is not supported on this device.";
}
else
{
var fl_Geolocation:Geolocation = new Geolocation();
fl_Geolocation.setRequestedUpdateInterval(60000); //android overrides setRequestedUpdateInterval()
fl_Geolocation.addEventListener(GeolocationEvent.UPDATE, fl_UpdateGeolocation);
fl_Geolocation.addEventListener(StatusEvent.STATUS, gpsStatusHandler);
}
function fl_UpdateGeolocation(event:GeolocationEvent):void
{
//gpsArray.push(event.latitude);
//gpsArray[gpsArray.length] = event.latitude;
gpsArray.unshift(event.latitude);
var speed:Number = event.speed * 2.23693629;
if (gpsArray[gpsArray.length - 2] != gpsArray[gpsArray.length - 1])
{
trace(gpsArray.length + "|" + gpsArray[gpsArray.length - 2] + "|" + gpsArray[gpsArray.length - 1]);
trace(gpsArray[1] + "|" + gpsArray[0]);
trace(gpsArray[gpsArray.length - 2] - gpsArray[gpsArray.length - 1]);
}
//this.removeChild(fl_GeolocationDisplay);
fl_GeolocationDisplay.parent.removeChild(fl_GeolocationDisplay);
//fl_GeolocationDisplay = null; //TypeError: Error #2007: Parameter child must be non-null.
addChild(fl_GeolocationDisplay);
fl_GeolocationDisplay.text = (event.latitude.toString() + " | " + event.timestamp.toString());
//fl_GeolocationDisplay.text = (event.latitude.toString() + "\n");
//fl_GeolocationDisplay.appendText(event.latitude.toString() + "\n");
//fl_GeolocationDisplay.appendText(event.longitude.toString() + "\n");
}
function gpsStatusHandler(event:StatusEvent):void {
if (fl_Geolocation.muted) {
fl_GeolocationDisplay.text = "Please verify the device's location settings.";
}
}
I really can't understand what it is that you are trying to do, I mean you say one thing but your code seem to say something different.
There is also a serious issue about where the different code snippets are located? It Seems like the top part is inside a constructor. And then the bottom part are their own functions? If that is the case, make sure that the constructor is not run multiple times (which seems to be the issue and explaining why items are "overwritten" on top of each other.
Also your question states something about appendText but it seems like you want to replace the text inside the textfield? AppendText will add extra text inside that text field.
Anyways, I did an implementation from your code that gets the "longitude|lattitude" from the update event and then appends these to the textfield on a new line. Maybe this is what you wanted to do? I commented out the gps-array since I had no idea what it was that you tried to achieve by doing this:
package {
import flash.events.GeolocationEvent;
import flash.events.StatusEvent;
import flash.sensors.Geolocation;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
public class Foobar extends MovieClip {
var gpsArray:Array = [42.09646417];
var format:TextFormat = new TextFormat();
var fl_GeolocationDisplay:TextField = new TextField();
var fl_Geolocation:Geolocation = new Geolocation();
public function Foobar() {
format.color = 0xff0066;
format.font = "Lucida Console";
format.size = 20;
fl_GeolocationDisplay.defaultTextFormat = format;
fl_GeolocationDisplay.x = 10;
fl_GeolocationDisplay.y = 20;
fl_GeolocationDisplay.selectable = false;
fl_GeolocationDisplay.autoSize = TextFieldAutoSize.LEFT;
//fl_GeolocationDisplay.text = "Geolocation is not responding. Verify the device's location settings.";
fl_GeolocationDisplay.text = " ";
addChild(fl_GeolocationDisplay);
if(!Geolocation.isSupported) {
trace("unsupported");
fl_GeolocationDisplay.text = "Geolocation is not supported on this device.";
} else {
trace("supported");
fl_Geolocation.setRequestedUpdateInterval(500); //android overrides setRequestedUpdateInterval()
fl_Geolocation.addEventListener(GeolocationEvent.UPDATE, fl_UpdateGeolocation);
fl_Geolocation.addEventListener(StatusEvent.STATUS, gpsStatusHandler);
}
}
function fl_UpdateGeolocation(event:GeolocationEvent):void {
/*gpsArray.unshift(event.latitude);
var speed:Number = event.speed * 2.23693629;
if (gpsArray[gpsArray.length - 2] != gpsArray[gpsArray.length - 1]) {
trace(gpsArray.length + "|" + gpsArray[gpsArray.length - 2] + "|" + gpsArray[gpsArray.length - 1]);
trace(gpsArray[1] + "|" + gpsArray[0]);
trace(gpsArray[gpsArray.length - 2] - gpsArray[gpsArray.length - 1]);
}*/
fl_GeolocationDisplay.appendText(event.latitude.toString() + "|" + event.longitude.toString() + "\n");
}
function gpsStatusHandler(event:StatusEvent):void {
if (fl_Geolocation.muted) {
fl_GeolocationDisplay.text = "Please verify the device's location settings.";
}
}
}
}
These codes are in neo4j-manual-milestone.pdf( version: 1.8M05):
TraversalDescription t = new TraversalDescription();
t.setOrder( TraversalDescription.DEPTH_FIRST );
t.setUniqueness( TraversalDescription.NODE );
t.setMaxDepth( 10 );
t.setReturnFilter( TraversalDescription.ALL );
t.setRelationships( new Relationship( "singer", Relationship.OUT ) );
// END SNIPPET: traversalDesc
// START SNIPPET: traverse
URI traverserUri = new URI( startNode.toString() + "/traverse/node" );
WebResource resource = Client.create()
.resource( traverserUri );
String jsonTraverserPayload = t.toJson();
ClientResponse response = resource.accept( MediaType.APPLICATION_JSON )
.type( MediaType.APPLICATION_JSON )
.entity( jsonTraverserPayload )
.post( ClientResponse.class );
System.out.println( String.format(
"POST [%s] to [%s], status code [%d], returned data: "
+ System.getProperty( "line.separator" ) + "%s",
jsonTraverserPayload, traverserUri, response.getStatus(),
response.getEntity( String.class ) ) );
response.close();
When I use them, the errors display.
If you go to the online version of the manual, at http://docs.neo4j.org/chunked/1.8.M05/tutorial-traversal-java-api.html at the bottom of the page there is a link to the full source, which is executed and tested together with the main neo4j build.
HTH
i want to know how to find application size in blackberry by code?
I want to display application name which are running along with its size on click of button, so how should i do it ?
I gave some explanation please see this link
https://stackoverflow.com/a/9074486/914111
Here the answer of your question.
You will get your answer with this link.
app details.
public class readjad extends FullScreen{
public readjad() {
VerticalFieldManager vfm = new VerticalFieldManager(VERTICAL_SCROLL);
ApplicationDescriptor desc = ApplicationDescriptor.currentApplicationDescriptor();
CodeModuleGroup[] group = CodeModuleGroupManager.loadAll();
if(group != null) {
for( int i=0;i<CodeModuleGroupManager.getNumberOfGroups();i++) {
Enumeration e = group[i].getPropertyNames();
e.hasMoreElements();
vfm.add(new RichTextField("\n\nGroup: " + group[i].getName() ));
String name = (String)e.nextElement();
vfm.add(new RichTextField(name + ": " + group[i].getProperty(name)));
vfm.add(new RichTextField("Copyright" + ": " + group[i].getCopyright()));
vfm.add(new RichTextField("Vendor" + ": " + group[i].getVendor()));
}
} else {
vfm.add(new RichTextField("Group is null"));
}
add(vfm);
}
}