I'm trying to use mina sshd 0.12.0 on android using spongycastle 1.51.

I've followed the instructions available, registered Spongycastle using

static {
  Security.insertProviderAt( new org.spongycastle.jce.provider.BouncyCastleProvider(), 1);

Spongycastle was verified to be registered cleanly and requesting the algorithm "EC":


works fine.

When I finally try to establish an ssh connection to the server it fails with the following stack trace:

java.security.NoSuchAlgorithmException: KeyPairGenerator EC implementation not found
    at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:113)
    at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:135)
    at java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:153)
    at java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:125)
    at org.apache.sshd.common.util.SecurityUtils.getKeyPairGenerator(SecurityUtils.java:157)
    at org.apache.sshd.common.kex.ECDH.<init>(ECDH.java:51)
    at org.apache.sshd.server.kex.ECDHP256.getDH(ECDHP256.java:48)
    at org.apache.sshd.server.kex.AbstractDHGServer.init(AbstractDHGServer.java:68)
    at org.apache.sshd.common.session.AbstractSession.doHandleMessage(AbstractSession.java:359)
    at org.apache.sshd.common.session.AbstractSession.handleMessage(AbstractSession.java:295)
    at org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:731)
    at org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:277)
    at org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:54)
    at org.apache.sshd.common.io.mina.MinaService.messageReceived(MinaService.java:107)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:854)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:542)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:943)
    at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:109)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:542)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:535)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:714)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:668)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:657)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)
    at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1121)
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
    at java.lang.Thread.run(Thread.java:1019)

I'm at a loss here. Is the inserted provider somehow thread local?

I'm thankful for any hints.

I have an app which uses Google Maps and GPScoordinates. I need the current location in multiple classes, and i don't want to use intent.putExtra and getExtra everytime. Can I make a certain value visible to all classes in my app?

I'm new to mobile development, and I'm trying to get a working development space set up to build and test apps.

I'm trying to use my LG G3 to test apps. I can't get the virtual machine to work, but from my experiences with following directions exactly as they say and triple-checking to make sure I didn't do anything wrong, I didn't really expect it to anyway, and I don't really care as long as I can get debugging to work on an actual device.

Except that I can't get the driver to install. When I plug in the device, it detects it as "VS985 4G", a device with two drives: "Internal storage" and "SD card". I tried updating the driver for "VS985 4G"; I go to device manager, right-click the device (under "Portable Devices"), and select "Update Driver Software..."; I click "Browse my computer...", and type in "extras\google\usb_driver" (replacing with the path to my sdk); then I click next, and it shows me this: http://imgur.com/XQIqdG2

So I attempt to launch the app from Eclipse (made by following the directions from this tutorial: http://developer.android.com/training/basics/firstapp/creating-project.html ), and it said "No compatible targets were found."

Does anyone know how to fix this?

I have this code:

public void writeXML()
        String profileFileName = "settings";
        FileOutputStream fOut = openFileOutput(profileFileName + ".xml", MODE_WORLD_WRITABLE);
        StringBuffer profileXML = new StringBuffer();
        profileXML.append("<sound_setting>" + soundEnabled + "<sound_setting>\n");
        OutputStreamWriter osw = new OutputStreamWriter(fOut);
    catch(IOException ioe )

and it is working properly, however, I have no idea where the output is located, and frankly, I would like to move the output to a server online. I have my own server and am hosting files for my application, however, I do not know how can I code this such in order to place the file on my localhost.

Thanks guys! What would I need for that and what would be the code necessary?

I am currently working on an android app and I am trying to get a colour animation to work.

Basically I have a LinearLayout that contains various componenets and when a certain event happens, I want the LinearLayout background colour quickly flash red.

I have an animation set up which I am trying to animate the colour so it fades in to the red then fades back out again. However, for some reason, there doesn't seem to be any animation when the colour first appears, only when it is fading back out again.

Below is my drawable

<transition xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- The drawables used here can be solid colors, gradients, shapes, images, etc. -->
    <item android:drawable="@color/transparentColour" />
    <item android:drawable="@color/errorColour" />

Below is how I am doing my transition

TransitionDrawable transitionDrawable = (TransitionDrawable)linearLayoutPlatform.getBackground();

Thanks for any help you can provide

So Adopting The Design Pattern described here whereby a Async Task wrapped around a retained fragment via the setRetainInstance as seen described here


Im having an issue where a task is started before the worker fragment can attach to the activity leaving the mCallBack to be null at the same time onPreExecute is called which throws a nullPointerException/

This is largely due to the fact that the async task is started via a method call (a start method which creates an instance of the inner async task) and not inside onCreate or OnActivityCreated since the task can be started again (under a new instance of it) and cannot be done so in onCreate or OnActivity created since the life cycle of these methods only call 1 time because of the setRetainInstance as far I as know.

My question is where a way to program some sort of routine whereby a wait until fragment has attached to activity routine and if so do the task that you need to do?

Many thanks.

Hi having a bit of trouble, have an app that currently sends last known lat and long co-ords via text when a 'code' is received. Wanting to change this to send back the address instead of co-ordinates. Can anyone help please?

public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub
    //get password from shared preferences
    SharedPreferences passwdfile = context.getSharedPreferences("passwd", 0);
    String password = passwdfile.getString("passwd",null);
    //instantiate LocationManager
    mgr = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
    Criteria criteria = new Criteria();
    provider = mgr.getBestProvider(criteria,true);
    Location lastLocation = mgr.getLastKnownLocation(provider);
    if (lastLocation!=null)
        loc = "Findme Latituted: " + lastLocation.getLatitude() + "Longitude: "
        + lastLocation.getLongitude();

    //get the messages - pdu = protocol description unit
    Bundle bundle = intent.getExtras();
    Object[] pdusObj = (Object[]) bundle.get("pdus");
    SmsMessage[] messages = new SmsMessage[pdusObj.length];
    for (int i = 0; i<pdusObj.length; i++) {
            messages[i] = SmsMessage.createFromPdu ((byte[])pdusObj[i]);
    for (SmsMessage msg : messages) {
        //make sure it's a findme message
        if (msg.getMessageBody().contains("findme:" + password)) {                             
            String to = msg.getOriginatingAddress();
            SmsManager sm = SmsManager.getDefault();
            sm.sendTextMessage(to, null, loc,null, null);

I have the following xml:


In PHP I can do something like

preg_match('~<TEST>([^<]+)</TEST>~i', $xml, $test);

But how do I get the value of TEST in android, if the parentnode is unknown?`

I'm making an android game with SDL that requires access to ifaddrs.h. when I compile for mac, it works fine. When I compile for Android, it says file not found.

I'm trying to include it like this:

#include <ifaddrs.h>

So I

gcc -M network.cpp

to find dependancies to the file it's included in, so I can find ifaddrs' absolute location, which is


so when I

#include "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/ifaddrs.h"

it finds it, but then errors on including some other dependency of ifaddrs

#include <AvailabilityInternal.h>

Ok. So, why is the include behavior different when I try to compile for android vs for mac? (using ndkbuild or g++ on mac)? how can I get it to work on android? what piece of knowledge/information am I missing for all this to sense?

(note- currently running OSX yosemite, 10.10)

I'm trying to make my app compatible to 2.3 and I'm stuck trying to make the setOnItemClickListener work. It works perfectly on 4.0 but it doesn't on 2.3. I've been researching and found I have to make android:focusable="false" android:clickable="false" my item in the XML but it still doesn't work. This is my code:


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

        android:src="@drawable/icon_4" />

        android:textSize="@dimen/size_item_menu" />



list_menu.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Log.e("onItemClick ", "Clicked");

Thanks in advance for any help.

Hey Guys I need a bit of help, I've been trying to figure this out, but for some reason I can't.

I've been having this error.

Please look at the mouse

I can't drag anything from my design "Palate" in the device.

Everything is updated, including Java, IDE version and APIs.

Any Ideas?

I've started new projects, and still no luck.

(Gradel syncs do nothing, clean projects do nothing, googling doesn't help because I don't really understand what I'm dealing with, other than I'm basically dragging and dropping pre made XML fragments.)


apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.0.1"

defaultConfig {
    applicationId "co.egdesigns.fuck"
    minSdkVersion 20
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.0.0'
compile 'com.google.android.gms:play-services-wearable:6.1.11'

I'm programmatically creating a UIButton and adding to the view of an IBOutlet UIButton in an XIB for a custom UITableViewCell.

Upon a check for "displayCustomButtonOfType", the button's instance is added to the cell's customButtonView.

Within the cell's class, the customButtonView is being set to nil within the prepareForReuse method.

What is happening on scroll is that the cell's custom button appears in other cells and upon scrolling back, the custom button appears in a different cell.

All text that appears in the cells is appearing as expected.

Is there an approved manner to add and remove a programmatically created UIButton to a custom UITableViewCell?

I have this issue when I tried to convert my app from iOS6 to iOS7/iOS8.

UITableView doesn't display the cells (working in iOS6)

UITableView doesn't display the cells (working in iOS6).

I have a similar view that works fine in iOS7 (it doesn't have the UISearchView)

Working fine in iOS7

I tried several workarounds like clear the background, delete the UISearchBar, etc...

The code is similar in both examples (cells are generated by - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPathmethod)

I used the Reveal software to analyze this hierarchy.

The code compiled in the XCODE 4 for iOS6 support is working fine. (tested on the iphone 5s with iOS7)

I've found what appears to be a bug in iOS Safari (I am testing on iOS 8). When an absolutely-positioned iFrame is floating above a piece of scrollable content, scrolling the iFrame also scrolls the content underneath. The following HTML (available on JSFiddle) reproduces it:

<div style="width:200px;height:200px;overflow:auto;-webkit-overflow-scrolling:touch;">
    <div style="width:500px;height:500px;background-color:red">Test</div>
<iframe scrolling="no" style="position:absolute;z-index:10000;left:50px;top:50px;width:200px;height:200px" src="http://randscullard.com/LinkedItems/iOSFrameScrollIssue.htm"/>

Load the JSFiddle in iOS 8 Safari, then touch-drag near the top left corner of the green box, where it says "Drag here!" (Start the drag so that your finger is entirely inside the green box, but also overlapping the red box underneath.) You will see the red box scroll instead of the green box, as shown in this image:

enter image description here

By contrast, if you start the drag inside the green box but NOT overlapping the red box, then the green box will scroll as you would expect.

I can't reproduce this behavior in any other browser. Has anyone else encountered this issue? Any known workarounds?

First, I know that in iOS 8, the UIActionSheet has been deprecated.

That said, an app that was compiled with an earlier SDK that contains a simple UIActionSheet should still present properly on iOS8. I have several apps and in ALL of them so far, any UIActionSheet no longer shows properly on iOS 8.

Oddly enough, if I recompile with iOS 8 it shows fine.

Is anybody else seeing this or has anyone else reported this as a bug? I would have expected more people to be commenting on this issue which is making me wonder if I'm doing something odd to cause the problem.

Here's the code for a simple action sheet and how it presents in iOS 7 and iOS 8.

UIButton *bn = (UIButton *)sender;
CGRect cr = [bn convertRect:bn.bounds toView:self.view];

UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil
for (int i=0; i < infoItems.count; i++){
    [as addButtonWithTitle:[infoItems objectAtIndex:i]];
[as showFromRect:cr inView:self.view animated:YES];

iOS 7:

enter image description here

iOS 8:

enter image description here

Nice, huh?


I'm having issues trying to get a subclass of UITextField to render properly in Interface Builder with IBDesignable. The subclass is pretty simple, it allows the user to define insets for the text placement in a UITextField. The code is as follows:

import Foundation

@IBDesignable public class CLYInsetTextField: UITextField {

    @IBInspectable public var topInset: CGFloat = 0 {
        didSet {
    @IBInspectable public var leftInset: CGFloat = 0 {
        didSet {
    @IBInspectable public var bottomInset: CGFloat = 0 {
        didSet {
    @IBInspectable public var rightInset: CGFloat = 0 {
        didSet {

    override public func textRectForBounds(bounds: CGRect) -> CGRect {
        return UIEdgeInsetsInsetRect(bounds, UIEdgeInsetsMake(topInset, leftInset, bottomInset, rightInset))

    override public func editingRectForBounds(bounds: CGRect) -> CGRect {
        return UIEdgeInsetsInsetRect(bounds, UIEdgeInsetsMake(topInset, leftInset, bottomInset, rightInset))

When using this class in a storyboard, the properties show up in IB perfectly fine, but when I try to update one of the values, Xcode builds the project and spits out the following two warnings:

error: IB Designables: Failed to update auto layout status: dlopen([APP_NAME].app, 1): no suitable image found.  Did find:
[APP_NAME].app: can't map unslidable segment __TEXT to 0x100000000 with size 0x7EB000

error: IB Designables: Failed to render instance of CLYInsetTextField: dlopen([APP_NAME].app, 1): no suitable image found.  Did find:
[APP_NAME].app: can't map unslidable segment __TEXT to 0x100000000 with size 0x7EB000

I can build and run in the simulator just fine, and when I do the view is rendered as I expect it to. It's just when I try to render it in IB that I am coming up against this issue. Other examples I have seen for making interactive custom views in Interface Builder seem to be just as simple as mine and run without problems. Is there a step I am missing, or is what I am trying to do simply not going to work?

For rich text editing I have a UIWebView where I load a local html content with some contenteditable div. When user is pressing some keys on keyboard I want to detect content changes within that div, resize it accordingly and scroll properly to position cursor above the keyboard.

I'm able to do this using onkeyup event handler:

<div id="contents" onkeyup="keyup()" onpaste="paste()" contenteditable="true">...</div>

In iOS 8 keyboard now has the Quicktype panel with some suggestion words to quickly paste into editable area. How to detect the action of pasting the suggestion text into div?

Event handler like onkeyup doesn't help as the text is pasted without pressing keyboard buttons, onpaste event is not get called. I also tried to implement MutationObserver to detect DOM changes when something is pasted - doesn't help too.

I'm struggling trying to find the working solution. Any advice is appreciated. Thanks!

Does anyone have this issue? I'm able to download and run the 7.1 simulator but I do not see the option to download 7.0.

So I am going to make an app with a large amount of images. I have seen that it is possible to drag images into the project and reference with UIImage.FromFile("filename"), but if I have lots of images it would be too much work to drag every single image into the project.

Any ideas of better ways to do this?

Apple has recently introduced a new process for translating files. You no longer have to use genstrings/ibtool for generating .strings file - instead of that you simply use export/import tool built right into the xcode and you operate on .xliff files. The whole process is described here: https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/LocalizingYourApp/LocalizingYourApp.html Unfortunately when I'm trying to import right from xcode, it crashes. I wanted to test it out using xcodebuild -importLocalizations as it is described for instance here: https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/BPInternational.pdf (page 68) but it turns out that there's no such argument for xcodebuild (there is exportLocalization though) ?! (man command confirms it) Am I missing something? [I also installed xcode 6.1 to test it out, still doesn't work]

I am trying to run an automated xcodebuild on Jenkins, but I am running into the error

User interaction is not allowed. Command /usr/bin/codesign failed with exit code 1

I have already referenced "User interaction is not allowed" trying to sign an OSX app using codesign and other similar threads, but none of the solutions seem to properly remedy the error.

Here is what I've already tried:

  • I have allowed all items to access the keychain, and I have specifically added codesign to the "always allow" list (as done here http://stackoverflow.com/a/22637896)

  • I have set the keychain to not automatically lock with a timeout, both through Keychain Access's settings, and through the command

    security set-keychain-settings -t 3600 -l <KEYCHAIN>
  • I have tried calling

    codesign --sign <CODE SIGN IDENTITY> --force ...

    before the project compiles (more specifically, this solution http://stackoverflow.com/a/20208104), and although this successfully builds the project I don't think that codesigning before compiling is correct or reliable. (edit: this also failed when run from jenkins)

Here are the commands I am executing:

security unlock-keychain -p <PASSWORD> <KEYCHAIN>

Something interesting to note is that building the project on the machine works with the commands above, but trying to run the exact same commands over ssh (and jenkins) causes the error.

Thanks in advance for your help!