I have made a test application in which SMS is sent by user's device to himself, to verify the Phone Number. But how does Hangouts app verify the phone number ? it is very quick !

Thanks

I have developed an app that is suppose to display images located in drawable folder..and the user can swipe between the images..However, being new to android I am curious if the effect shown in this youtube link is possible.. http://www.youtube.com/watch?v=52mXHqX9f3Y . The used flipper however, I have viewpager....So any code help along with explanation will be appreciated..I also saw Some SO question regarding this matter where user wanted to swipe between a,b and c images..But I don't want to achieve those effects..

Following are my codes...

Imageadapter.java

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class ImageAdapter extends PagerAdapter {
    Context context;
    private int[] GalImages = new int[] {
        R.drawable.one,
        R.drawable.two,
        R.drawable.three,
        R.drawable.four,
        R.drawable.five
    };
    ImageAdapter(Context context){
        this.context=context;
    }
    @Override
    public int getCount() {
      return GalImages.length;
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
      return view == ((ImageView) object);
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
      ImageView imageView = new ImageView(context);
      int padding = context.getResources().getDimensionPixelSize(R.dimen.padding_small);
      imageView.setPadding(padding, padding, padding, padding);
      imageView.setScaleType(ImageView.ScaleType. FIT_XY  );
      Resources r = context.getResources();
      Bitmap bmp = BitmapFactory.decodeResource(r, GalImages[position]);
      int width=200;//set your width
      int height=200;//set your height
      Bitmap resizedbitmap = Bitmap.createScaledBitmap(bmp, width, height, true);
      Drawable d = new BitmapDrawable(r,resizedbitmap);
      Drawable[] layers = new Drawable[2];
      layers[0] = d;
      layers[1] = r.getDrawable(R.drawable.a);
      LayerDrawable layerDrawable = new LayerDrawable(layers);
      imageView.setImageDrawable(layerDrawable);
      ((ViewPager) container).addView(imageView, 0);
      return imageView;
    }
    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
      ((ViewPager) container).removeView((ImageView) object);
    }
  }

activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
   android:layout_height="match_parent" 
    tools:context=".MainActivity"
    android:icon="@drawable/icon" >


          <android.support.v4.view.ViewPager
          android:id="@+id/view_pager"
          android:layout_width="match_parent"
          android:layout_height="match_parent" 
         android:icon="@drawable/icon"
         />
           <ImageView
        android:id="@+id/swipe_left"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:src="@drawable/swipe_left" />

    <ImageView
        android:id="@+id/swipe_right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:src="@drawable/swipe_right" />

</RelativeLayout>

So I'm having this issue with my game that I'm working on for practice and one of the things that I'm struggling with is having this random color change between these four colors red, green, blue, yellow. My objective is to have this ball bounce around the screen while changing between the four colors but I would like to have a delay or pause in between the swapping of the colors like for at least 3 or 5 seconds. So far in the code the ball seems to change but without delay I've tried using a few delay methods like Timer.Schedule but eveytime I use this the ball bounces around the screen but its all black and no color I would really appreciate any help? I felt silly asking a question like this because I have a feeling it may be a small issue.

  public void ballColorSwap(){
    int rnd = (int)(Math.random() * 4);
    if(rnd == 1){
        ballColor.set(Color.RED);
        }
        if(rnd == 2){
            ballColor.set(Color.BLUE);
        }
        if(rnd == 3){
            ballColor.set(Color.GREEN);
        }
        if(rnd == 4){
            ballColor.set(Color.YELLOW);
        }
    }
private void drawBall(float dt) {
    ballRenderer.circle(ball.getX(), ball.getY(), 20);
    ballRenderer.setColor(ballColor);

}

I have a simple Android app, which is a HTML5 canvas.

Upon loading, the app resizes the canvas to match the window.innerWidth and window.innerHeight.

However, for some reason when I hold my finger on the app and move it, i can slightly drag the whole canvas a pixel or two. Is there anyway to prevent the canvas from moving? I don't understand why it happens, the canvas should not be bigger than the window.

If i wanted to make a game that had a similar menu layout to games like candy crush would it be better to use fragments or activities.

So when the user clicks on the app icon your immediately hit with a loading screen (loading textures and media) then before actually getting to play a level you go through 2 or 3 different menus.

From past experience with activities it would be quite difficult to load all the game data in the first activity and keep a reference to it through 2 or more additional activities.

So is the answer here to use fragments?

I am trying to make a simple push notification application where I am using Parse dot com for the back-end and I followed the instructions from several tutorials.

Problem 1 : When I define my application id's and client id's, and use that in the manifest, the application just freezes and gives an ANR.

This is a basic setup I am using for defining the keys :

public class EntryPoint extends Application {

    @Override
    public void onCreate() {
        // TODO Auto-generated method stub
        super.onCreate();

        ParseObject.registerSubclass(ParseModel.class);

        // Parse.initialize(this, "YOUR_PARSE_APPLICATION_ID",
        // "YOUR_PARSE_CLIENT_KEY");
        Parse.initialize(this, "your_app_id",
                "your_client_id");

        PushService.setDefaultPushCallback(this, MainActivity.class);

        ParseInstallation.getCurrentInstallation().saveInBackground();


        String droidID = Secure.getString(getApplicationContext().getContentResolver(),Secure.ANDROID_ID);         

        ParseInstallation installation = ParseInstallation.getCurrentInstallation();    

        installation.put("UniqueId",droidID);

        installation.saveInBackground();

    }

}

And this is the manifest :

<application
        android:name="com.mike.EntryPoint"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/CustomActionBarTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity> 

<application

NOTE : Other receivers and services are defined already in the manifest.

When I remove android:name="com.mike.EntryPoint" from the application tag, the app runs fine and no issues with it. But in order to use push notifications, we do need the tag names in the application tag.

Is there something I am missing or is there a other work around using push notifications using parse backend ?

If it is, I will really appreciate your help. Thanks in advance .. :)

I'm currently writing an app and would like some advice on best practices.

The idea of the app is to open it up, scan for and then select a bluetooth device (this is BLE by the way) and connect to it. I'd then like to send a command via Bluetooth every time a notification or call is received (this would be done in the background).

I've got the scanning and connecting part working and know I can use the notificationlistenerservice and phonestatelistener (or similar) for detecting the calls & notifications. These will both be set up as individual services. I can also manually send serial data to the bluetooth module via the main activity.

What I'd like advice on is the best way to maintain a connection to the Bluetooth module and send it specific commands (serial data) when a notification/call is received. Should I run a service for maintaining a connection to the module or should I duplicate the code for each service and connect to the module each time I want to send data to it? If I have a background service for the Bluetooth connection I would want the activity and call/notification services to be able to call methods on it to then send the required data to the module.

Hopefully this makes sense and thanks in advance.

I have been stuck on this problem for days, hoping someone can help. I am trying to update a contacts photo with a specific image using the CONTACT_ID, but this doesn't appear to be working. Do I have to use RAW_CONTACT_ID in order to do this? Because ideally I would like to apply the same photo to all raw contact components of the same contact id. Here is my code:

@Override
protected void onCreate(Bundle savedInstanceState) {

//set up contact list
SimpleCursorAdapter mAdapter = new SimpleCursorAdapter (this, android.R.layout.simple_list_item_2,
            null, new String[] {Contacts.DISPLAY_NAME}, new int[] {android.R.id.text1}, 0);
ListView contactList = (ListView)findViewById(android.R.id.list);
contactList.setAdapter(mAdapter);

//set up intents for when a contact is selected
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Log.d(TAG, "action pick");
startActivityForResult(intent, PICK_CONTACT);
} 

@Override
protected void onActivityResult (int reqCode, int resultCode, Intent data) {
    super.onActivityResult(reqCode, resultCode, data);

    super.onResume();

    switch (reqCode) {
    case (PICK_CONTACT):
        if (resultCode == Activity.RESULT_OK) {
            contactData = data.getData();
            //get _ID (contact id based on first column in contact database
            if (contactData != null) {
                Cursor cursor = getContentResolver().query(data.getData(), null, null, null, null);
                if (cursor!=null && cursor.moveToNext()) {
                    contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Data._ID));
                    cursor.close();

                }
            }

            Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.woman);
            ByteArrayOutputStream stream = new ByteArrayOutputStream();
            bitmap.compress(CompressFormat.PNG, 0, stream);
            byte[] imageBytes = stream.toByteArray();   

             ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
             ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
                        .withSelection(ContactsContract.Data._ID + " = ?", new String[] 
                        {contactId}).withValue(ContactsContract.Data.DATA15,imageBytes).build());

             try {
                cr.applyBatch(ContactsContract.AUTHORITY, ops);
            } catch (RemoteException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (OperationApplicationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

    //view contact
    Intent intent = new Intent(Intent.ACTION_VIEW);
    Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, contactId);
    intent.setData(uri);
    startActivity(intent);
    break;
    }

}

I tried using rawContactUri, but I don't think this is the same as the RAW_CONTACT_ID. Does anyone have any suggestions on how to do this?

I am using the sample for the app here https://github.com/itog/Twitter4j-android-Sample and it is working. I use the same method in my app but it return null when I at line

static final String CALLBACK_URL = "oauth://t4jsample"; [Copy the same as the Sample]
requestToken = twitter.getOAuthRequestToken(CALLBACK_URL);

Here are my manifest

<activity
        android:name="com.my.app.SharePreviewActivity"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.Fullscreen"
        android:windowSoftInputMode="stateAlwaysHidden|adjustPan" >

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:host="t4jsample"
                android:scheme="oauth" />
        </intent-filter>
    </activity>

This is other code which I copy the same from the sample app.

private void askOAuth() {
    ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
    configurationBuilder.setOAuthConsumerKey(CONSUMER_KEY);
    configurationBuilder.setOAuthConsumerSecret(CONSUMER_SECRET);
    Configuration configuration = configurationBuilder.build();
    twitter = new TwitterFactory(configuration).getInstance();

    try {
        requestToken = twitter.getOAuthRequestToken(CALLBACK_URL);
        Toast.makeText(this, "Please authorize this app!",
                Toast.LENGTH_LONG).show();
        this.startActivity(new Intent(Intent.ACTION_VIEW, Uri
                .parse(requestToken.getAuthenticationURL())));
    } catch (TwitterException e) {
        e.printStackTrace();
    }
}

I am very new to Android development.

I used Objective-C category extension and method swizzling to extend existing methods. What are the equivalent strategies in Android development?

An example is a category of ViewController and swizzling the viewDidLoad method:

@implementation ViewController (Swizzle)

+ (void) load {

Method original, swizzled;

original = class_getInstanceMethod(self, @selector(viewDidLoad));

swizzled = class_getInstanceMethod(self, @selector(swizzle_viewDidLoad));

method_exchangeImplementations(original, swizzled);  

}

- (void) swizzle_viewDidLoad {

//Do my stuff here and then call the original viewDidLoad method 

[self swizzle_viewDidLoad];

}

@end

I've got a bit of an odd bug at the moment. I'm using the AudioManager to play a looping clip, but first requesting audio focus:

private void startPlayer(Sound sound) {

    audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
    int result = audioManager.requestAudioFocus(this, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);

    if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
        initMediaPlayer(sound);
    } else {
        Toast.makeText(getApplicationContext(), "Could not play audio at the moment...", Toast.LENGTH_LONG).show();
    }
}

In my stop() method I'm running:

....  
if (player != null) {
    if (player.isPlaying()) {
        player.stop();
    }

    player.reset();
    player.release();
    player = null;
}
....

...and in my start method I initialise the player using:

...
player = MediaPlayer.create(getApplicationContext(), lookupSoundId(sound));
player.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);
player.setLooping(true);
player.start();
...

I've implemented an onAudioFocusChange method which stops the audio if something else plays audio. This all works perfectly.

@Override
public void onAudioFocusChange(int focusChange) {
    switch (focusChange) {

        case AudioManager.AUDIOFOCUS_GAIN:
            if (player == null) {
                initMediaPlayer(currentSound);
            } else {
                if (!player.isPlaying()) {
                    play(); // this method updates the UI and starts the player
                }
            }
            player.setVolume(1.0f, 1.0f);
            break;

        case AudioManager.AUDIOFOCUS_LOSS:
            Log.d("onAudioFocusChange", "AudioManager.AUDIOFOCUS_LOSS");
            if ((player != null) && (player.isPlaying())) {
                stop(); // this method updates the UI and stops the player
            }
            break;

        case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
            Log.d("onAudioFocusChange", "AudioManager.AUDIOFOCUS_LOSS_TRANSIENT");
            if ((player != null) && (player.isPlaying())) {
                player.pause();
            }
            break;

        case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
            Log.d("onAudioFocusChange", "AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK");
            if ((player != null) && (player.isPlaying())) {
                player.setVolume(0.2f, 0.2f);
            }
            break;
    }
}

My issue is described as a series of steps, as it's a bit weird and it's running on a Nexus 5 with Android L developer preview (LPV79) installed:

  1. Press play in my app and the loop starts playing
  2. Press pause in my app and the loop stops
  3. Repeat this ad infinitum and all is well
  4. Press play in my app then open Google Music Player and press play—my app stops playing and music starts to play
  5. Press pause in Google Music Player
  6. Return to my app
  7. Press play in my app and the loop starts playing
  8. Press pause in my app and the loop stops
  9. Press play in my app and the UI updates as if the audio is playing but no audio is playing
  10. Press pause in my app then play then pause then play etc but no audio will play, although the UI is updating and the code seems to all be running and with no errors/warnings

11a. Terminate Google Music Player app 12a. Press play in my app and the loop starts playing

11a. Wait for 5 minutes 12b. Press play in my app and the loop starts playing

Also, at the end of my stop() method, I'm calling audioManager.abandonAudioFocus(...); to say I don't need audio focus at the moment.

The annoying thing is that when I try to debug this and put breakpoints in, the audio plays fine. I'm not really sure what's causing it. :/

i always found the answer to my Questions in StackoverFlow but not this time, so i'm trying to ask it, and i hope that you can help me, and Thanks even if you coudn't.

I'm trying to use the mysql query " Selet * From Table " and returning a resultset from asynctask using ".get()" the problem is that after executing the query and getting the returned value when the asynctask trys to get back in the program he loop infinitly, PS:when i use other query like "Select * From Table Where something = otherthing" it works perfectly.

here 2 methodes in my class DataBaseManager which got 2 params: Conn type connexion and member type ResultSet

/* asynctask pour la connexion*/public void Selmem(String ...a){
final class Select_member extends AsyncTask<String, Integer, ResultSet> {

    @Override
    protected ResultSet doInBackground(String... params) {



        try {
            ResultSet member2;
            String myDriver = "com.mysql.jdbc.Driver";
            Class.forName(myDriver).newInstance();
            conn = DriverManager.getConnection(params[0], "root", "");

            if(params.length==6)
            member2=select_member(params[1],params[2],params[3],params[4],params[5]);
            else
            member2=select_member(params[1],params[2],params[3]);

            conn.close();
            return(member2);


        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            Log.i("printf","NOT SELECTED");
            return null;    
        }

        // TODO Auto-generated method stub

    }


}

try {
    if(a.length==6)
    member=new Select_member().execute(a[0],a[1],a[2],a[3],a[4],a[5]).get();
    else
    member=new Select_member().execute(a[0],a[1],a[2],a[3]).get();

} catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (ExecutionException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

}

public ResultSet select_member(String ...a){
    String sql;
    PreparedStatement prest;
    try {
    if(a.length==5)
        {
        sql="SELECT * FROM `?` WHERE ? = '?' and `?` = '?'";
        prest= conn.prepareStatement(sql);
        prest.setString(1, a[0]);
        prest.setString(2, a[1]);
        prest.setString(3, a[2]);
        prest.setString(4, a[3]);
        prest.setString(5, a[4]);
        }
    else if (a[2].equals(""))
        {
        sql="SELECT * FROM `?`";
        prest= conn.prepareStatement(sql);
        prest.setString(1, a[0]);
        }
    else
        {
        sql="SELECT * FROM `?` WHERE `?` = '?'";
        prest= conn.prepareStatement(sql);
        prest.setString(1, a[0]);
        prest.setString(2, a[1]);
        prest.setString(3, a[2]);
        }

 prest= conn.prepareStatement(sql);
ResultSet member1;
member1 = prest.executeQuery();
ResultSet member2=member1;
if(member1.next())
return member2;
else
return null;



} catch (Exception e) {
     e.printStackTrace();
     return null;
     }

                            }

this is where i Call my Class to try to Select from my database, ps: the program dosen't even get to my loop (so i don't think that my loop is the problem i used the debugger to see where is the problem)

public class Deniere_Op extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_deniere__op);
    Intent activite=getIntent();
    DataBaseManager base=new DataBaseManager();
    String login=activite.getExtras().getString("login");
    base.Selmem("jdbc:mysql://10.0.2.2:3306/db_app",login , "", "");
    if(base.member==null)
    {
        Toast.makeText(getApplicationContext(), "Aucune Transaction",Toast.LENGTH_LONG).show();
    }
    else
    {int i=0;
        do{i++;
        for(int j=1;j<=6;j++)
        {String concat=new String();
        concat=concat.valueOf(i)+concat.valueOf(j);
        String message;
        try {
            message = base.member.getString(j);
            String a="textview"+concat;
            int resID=getResources().getIdentifier(a, "id",getPackageName());           
            TextView text=(TextView) findViewById(resID);
            text.setText(message);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }




        }
        try {
            base.member.next();
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        }while(base.member!=null);
    }
}

I hope that this can make you understand my problem and helps you to help me :D :D.

I'm trying to format this way any input String or Date to "MMM dd, yyyy" :

public Date format(Object date) {
    if (date instanceof String) {
        date = stringToDate(date + "");
    }
    return stringToDate(dateToString((Date) date));
}

public String dateToString(Date date) {
    return (new SimpleDateFormat("MMM dd, yyyy")).format(date);
}

public Date stringToDate(String dateStr) {
    try {
        return (new SimpleDateFormat("MMM dd, yyyy")).parse(dateStr); // HERE IS WHERE THE ERROR MESSAGE TRIGGERS
    } catch (ParseException e) {
        e.printStackTrace();
        return null;
    }
}

But, proceeding this way I get an error message saying:

java.text.ParseException: Unparseable date: "Thu Sep 11 00:00:00 UTC+01:00 2014" (at offset 0)
09-11 22:44:30.590  29020-29020/com.mypharmacy.app W/System.err﹕ at java.text.DateFormat.parse(DateFormat.java:626)
09-11 22:44:30.590  29020-29020/com.mypharmacy.app W/System.err﹕ at com.mypharmacy.helpers.DateHelper.stringToDate(DateHelper.java:26)
09-11 22:44:30.590  29020-29020/com.mypharmacy.app W/System.err﹕ at com.mypharmacy.helpers.DateHelper.format(DateHelper.java:15)
09-11 22:44:30.590  29020-29020/com.mypharmacy.app W/System.err﹕ at com.mypharmacy.dao.DrugDAOImpl.getAll(DrugDAOImpl.java:55)

How to fix this, please ?

I have a feature in my iOS application. The user has the option to save photo or video to the iPhoto app. When the user presses the 'Save' button, it saves the photo or video again. Is there a way to overwrite the existing file instead of saving it again.

     [self writeVideoAtPathToSavedPhotosAlbum:url completionBlock:^(NSURL* assetURL, NSError* error)  {
                       //error handling
                       if (error!=nil) {
                           completionBlock(error);
                           return;
                       }

                       //add the asset to the custom photo album
                       [self addAssetURL: assetURL
                     withCompletionBlock:completionBlock];

                   }];

Any suggestion on this? Using checksum?

I have a phonegap custom camera plugin that uses a overlayView(which is a subclass of UIView) to add a button on the camera page to access the photoLibrary. The button can be displayed properly, but when I try to press the button, nothing happens. I can only set the target of the button action to methods inside the overlayView class, anything outside of that class is not accessible. Odd thing is, the same code works on a normal project. Is there anything special that needs to be done with the phonegap plugin?

Thanks in advance!

I am trying to make a simple GET request using NSURLConnection in XCode 6 (Beta7 2) on iOS 8 SDK, which is failing with "Code 1005, the network connection was lost". The call fails when I try to fetch http://www.google.com or a few other sample pages from the web, but succeeds if I make a request to a simple HTTP server on localhost (python -m SimpleHTTPServer). I have also tried using AFNetworking library (2.4.1) - URLs that fail with NSURLConnection also fail with the library.

Here's my code -

NSString * url = @"http://0.0.0.0:8000";
// NSString * url = @"http://www.google.com";

NSLog(@"URL : %@", url);

// Mutable is probably not required, but just in case it REALLY WANTS me to set HTTP method
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
[theRequest setHTTPMethod:@"GET"];

NSURLResponse *urlResponse = nil;
NSError *error = nil;

NSData * data = [NSURLConnection sendSynchronousRequest:theRequest
                                      returningResponse:&urlResponse
                                error:&error];

if (error == nil) {
    NSString *response = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
    NSLog(response);
} else {
    NSString *response = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
    NSLog(@"%@", [error userInfo]);
}

Logs:

2014-09-11 17:34:23.950 SearchExample[5092:2074687] URL : http://www.google.com
2014-09-11 17:34:24.023 SearchExample[5092:2074687] {
    NSErrorFailingURLKey = "http://www.google.com";
    NSErrorFailingURLStringKey = "http://www.google.com";
    NSLocalizedDescription = "The network connection was lost.";
    NSUnderlyingError = "Error Domain=kCFErrorDomainCFNetwork Code=-1005 \"The network connection was lost.\" UserInfo=0x7fc8515640a0 {NSErrorFailingURLStringKey=http://www.google.com/, NSErrorFailingURLKey=http://www.google.com/, _kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1, NSLocalizedDescription=The network connection was lost.}";
    "_kCFStreamErrorCodeKey" = 57;
    "_kCFStreamErrorDomainKey" = 1;
}
2014-09-11 17:34:24.023 SearchExample[5092:2074687] URLResponse: (null)

I'm trying to create and validate an archive for an iOS app. I can run on the simulators and create the archive, but when I try to validate the archive, I get the following messages :

enter image description here

The plist location seems properly set in the build settings (when I change it I can no longer run on the simulator).

Any clue of what is missing ?

Thanks

My problem:
I have a navigation controller. When I navigate in to a specific part of the app, I initialize this code: http://rdsquared.wordpress.com/2012/10/19/circular-scrolling-inertia/

With this I have an image, which I can rotate with my finger. It uses a custom delegate. If the image rotates, and I press the back button (or swipe back) the app crashes.

In the code it says this:

// Taking a risk here that the delegate will not change or be destroyed while we're in the middle of animating the deceleration
if (self.delegate != NULL && [self.delegate respondsToSelector:@selector(rotationDidChangeByAngle:)]) {

And when the app crashes, it crashes at this point: (because the delegate gets destroyed when the user goes back)

[self.delegate rotationDidChangeByAngle:changeThisFrame];

I'm trying to understand and rewrite the code, that's why I keep referring to another persons source code.

What I want to do:
I want to be able to rotate the image, and then press the back button while it's decelerating. (And then make the image stop offscreen)

Can anyone come up with a workaround to the delegate problem? Please check Ryan's source code for more information. Thank you very much.

I have a UITableView which height is defined by a constraint named "tableViewHeightConstraint". The UITableView is a sub-view of a UIView named "view".

I animate the height of the UITableView using following code:

[self.view layoutIfNeeded];
[UIView animateWithDuration:0.25 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut
                 animations:^{

                     /* some other constraints */

                     self.tableViewHeightConstraint.constant = 200;
                     [self.view layoutIfNeeded];
                 } completion:^(BOOL b) {
        }];

When [self.view layoutIfNeeded] is called inside the animations block the changing height is animated as expected. But [self.view layoutIfNeeded] also calls tableView:cellForRowAtIndexPath where UITableViewCells are dequeued. On every dequeued cell the text and the imageView is programmatically updated.

The problem is that all those UITableViewCells are animated as well. This means that every time the UITableView's height is animated the text in those UITableViewCells moves horizontally from the very left to the intended text position. But I only want to have an animation in vertical direction (height) and not in horizontal direction.

How can I exclude everything that happens inside tableView:cellForRowAtIndexPath from being animated?

Why is the text in the UITableViewCell animated at all?

Is it possible to transfer any media from an iphone to a windows phone without using internet?

I have written this program but it doesn't stop executing. Can you help me with it?

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package inplacesort;

import java.util.*;
/**
 *
 * @author ASUS
 */
public class InplaceSort 
{
    static Scanner console = new Scanner(System.in);

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        Vector <Integer> intList = new Vector <Integer> ();

        //getting the numbers from the user
        char ans = 'y';

        while (ans == 'Y' || ans == 'y')
        {
            System.out.print("Enter a Number: ");
            intList.addElement(console.nextInt());

            System.out.print("Do You Want to Continue?(Y/N)");
            ans = console.next().charAt(0);
        }
        System.out.println(intList);
        for (int i = 1; i < intList.size(); i++)
        {
            //if (intList.elementAt(i) < intList.elementAt(i-1))
            //{
            int j = i - 1;
            while (j > 0 && intList.elementAt(i) < intList.elementAt(j))
            {
                j--;
            }

            for (int k = intList.size() - 1; k >= j; k--)
            {
                intList.insertElementAt(intList.elementAt(k),k + 1);
            }

            intList.insertElementAt(intList.elementAt(i+1),j);
            intList.removeElementAt(i+1);
            //}
        }
        System.out.print(intList);
    }
}