since my old MacBook crashed and not able to revive, I have gotten a new macbook and load my project from SVN.

Because of this I faced problem with the code signing. So I deleted all my cert and provision profile from Apple developer and regenerated new set. I have successfully archive the app now.

Problem is the push notification is not working already. Even I have replaced re generated p12 on my server. My old app, ad hoc new app all don't receive message anymore.

Anybody can advise me where to check? Thanks.

I'm experiencing a bit of a weird issue and I'm hoping someone can point me in the right direction.

In Xcode, using storyboard, I have a view controller that inherits a navigation bar. This is working fine. Where the issue is is that when I add an element to the view controller (ie, UIButton, UILabel, etc) and run the application on my phone, the Y positioning of the element is off by the amount of the height of the navigation bar.

Let's say I wanted to have a UIButton DIRECTLY BELOW the navigation bar, I would have to move it UNDER the navigation bar, to the very top of the view controller on the Storyboard. On my phone it would be directly below (Y positioning) the Navigation Bar.

I'm fairly new to iOS development, so I'm not even sure where to begin. I tried enabling / disabling Auto Layout, which didn't change anything.

In my application I am downloading many pdf, audio & videos files into sandbox. Total size of all these files is around 8GB.

For downloading all these files I am using NSOperationQueues. Files are getting downloaded and when ever downloaded files size reaches to 1GB, the app shows a low memory warning and the app crashes.

Is there any limit in downloading files into sandbox? Please help me how to resolve this issue. I was stuck at this issue for the last 4 months.

I have a Phonegap app that saves images the user takes from the camera to the device file system. I want to be able to access this image object in iOS/Objective C but can't seem to figure out how and don't see any explanations that solve the issue.

I'm able to see the path to the file (something like "file:///var/mobile/Containers/Data/Application/XXXX-XX-XXXXX/Documents/tempImg.jpg"), and can display this image properly setting HTML img src to this location, but when I try to access the image object in native code something is not working. I've tried using the code below

[UIImage imageWithContentsOfFile:imgName]

where imgName is the path in quotes above, but it does not work. Should I be doing something else?

I've checked all the Stack Overflow answers I could find like the link below, but nothing's working

Load a Saved Image in iOS

Appreciate any help!

I'm trying to Cancel Notification on Tap of Notification which is working perfectly fine below 5.0. But somehow that same notification is not autoCancel in Android 5.0

Here's what i used to cancelNotification (Works smoothly < 5.0)

PendingIntent resultPendingIntent = PendingIntent.getActivity(ctx,
uniqueID, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT);

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
                .setSmallIcon(R.drawable.ic_stat_mobcast_notification)
                .setContentTitle(message)
                .setContentText(title)
                .addAction(android.R.drawable.ic_menu_gallery, title,
                resultPendingIntent);
        mBuilder.setDefaults(-1);
        mBuilder.setOnlyAlertOnce(true);
        mBuilder.setAutoCancel(true);
        mBuilder.setContentIntent(resultPendingIntent);
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inPreferredConfig = Bitmap.Config.ARGB_8888;

        Notification notification = new NotificationCompat.BigPictureStyle(
                mBuilder).bigPicture(
                BitmapFactory.decodeFile(mImagePath, options)).build();

        NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
            mNotificationManager.notify(434, notification);

Tried :-

Try to cancel the notification where the pendingIntent leads to. But no still notification is there on Notification Bar(5.0)

What could be the Extra Flag which i missed out to set for 5.0 will autoCancel notification on Tap of it?

In my project I have a navigation drawer that's in the MainActivity.java. Each item in that drawer starts a different fragment that takes up the entire screen space. One of these fragments has buttons that need to launch an Activity (this activity extends MainActivity.java - the rationale behind this was to keep the navigation drawer available). When I press any of the buttons in that one fragment to launch another activity, I get this error

java.lang.RuntimeException: Unable to start activity ComponentInfo{.AddWorkoutActivity}: java.lang.IllegalArgumentException: 
No view found for id 0x7f0a0041 (id/contentFrame) for fragment NewLogFragment{529f3328 #0 id=0x7f0a0041}

Here, NewLogFragment is the fragment that tries to launch a new activity.

Basically, the structure of my project goes like this: MainActivity:java -> contains the NavDrawer and launches a fragment -> This fragment then launches another activity, which results in an error.

Here's my some of my code:

public class MainActivity extends ActionBarActivity {
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // rest of the code. Note, DrawerList is the list of items in the drawer.

        DrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                int editedPosition = position + 1;
                Toast.makeText(MainActivity.this, "You selected item " + editedPosition, Toast.LENGTH_SHORT).show();

                FragmentManager fragmentManager = getSupportFragmentManager();
                FragmentTransaction ft = fragmentManager.beginTransaction();

                switch(position){
                    case 0:

                        ft.replace(R.id.contentFrame, new NewLogFragment()).commit();

                        break;

}
                mDrawerLayout.closeDrawer(mDrawerList);
            }
        }); // ... rest of the code

activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/primary"
        app:popupTheme="@style/Theme.AppCompat"
        app:theme="@style/ToolbarTheme" />



    <!-- Main layout -->
    <android.support.v4.widget.DrawerLayout
        android:id="@+id/drawer"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout
            android:id="@+id/contentFrame"
            android:layout_width="match_parent"
            android:layout_height="match_parent"></FrameLayout>


        <!-- Nav drawer -->
        <ListView
            android:id="@android:id/list"
            android:layout_width="305dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:background="@android:color/white" />
    </android.support.v4.widget.DrawerLayout>    
</LinearLayout>

NewLogFragment.java

public class NewLogFragment extends Fragment {


    private Button bt_button;

    @Override
    public View onCreateView(LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {

        View rootView = inflater.inflate(R.layout.newlog_layout, container, false);
        bt_button = (Button) rootView.findViewById(R.id.bt_button);

        bt_button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), AddWorkoutActivity.class);
                intent.putExtra("type", 1);
                startActivity(intent);
            }
        });

    return rootView;
}

@Override
    public void onDestroyView() {
        super.onDestroyView();
    }

newlog_layout.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/fragmentOne">

    <LinearLayout
        android:id="@+id/ll_buttons"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <Button
            android:id="@+id/bt_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/bt_button" />


    </LinearLayout>

</RelativeLayout>

Perhaps I didn't structure my project correctly... but I've looked online and this should work nonetheless. No clue what's wrong. Any suggestions on the best way to structure my project are appreciated as well (in terms of whether to keep it this way or make everything a fragment or an activity). But I'd like to get this problem solved first.

I developed an android project on my laptop. This android project is in encrypted mode on my laptop hard disk. I took backup of this project onto my external hard disk (This got copied in encrypted mode itself). My laptop runs on windows 7 OS.

Now my laptop hard disk crashed. Before replacing this crashed hard disk, I've tried taking backup of data into my external hard disk using another laptop. But the encrypted android project folder did not get copied no matter what I did. It said 'encrypted files cannot be copied' for the android project. The directory structure got copied but files did not.

Now my original hard disk will be replaced in a couple of days. Thankfully I have the latest version of my android project on my external hard disk.

Now when I try copying my project from external hard disk to another laptop and it says 'cannot copy encrypted files'.

Now my queries are - 1. on my new hard disk will i be able to open my android project (after copying it from my external hard disk)? 2. how do i de-crypt the project files so that I can work with them on another laptop? 3. Is the encryption done at the hard disk level - meaning if i change the hard disk, will i loose my project?

I spent 30 man days (excluding my day job working hours) on this android project and it is very important for me. Any help is highly appreciated.

Thanks in advance, Sarat.

I have a subclass checkLoginTask in my Activity LoginActivity (this activity is for the login of a user) . This subclass is called from in the onPostExecute() from a class that extends AsynTask.

I want to destroy the activity LoginActivty if theLoginOk == "ok" and start the activity MainActivity. I used finish() but I got a error Non-Static method "finish()" cannot be referenced from a static context

I tried with final Activity activity = this; but does not worked.

this is the method on my Avtivity LoingPage

public static void checkLoginTrue(JSONObject jsonObject, Context context){
    if(jsonObject != null) {
        Intent intent = new Intent(context, MainActivity.class);

        try {
            JSONObject student = jsonObject.getJSONObject("status");
            String theId = student.getString("id");
            String theLoginOk = student.getString("login");

            Log.i("JSON login", theLoginOk);

            if (theLoginOk.equals("ok")) {
                intent.putExtra("id", theId);
                intent.putExtra("login", theLoginOk);
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(intent);
            } else {
                // something
            }

        } catch (JSONException e) {
            Log.w("error", e.getMessage());
        }
    }
}

How can I solve this?

What are the good sample projects in github which used tess-two repository?

The purpose of this app is to hide a secret message inside an edittext and to display the message when the user presses a button. The problem I have is that to iniate the secret message, the user needs to start typing and then use a period to start the process. On the period press and until the user presses a comma, any key thats pressed that would appear on the edittext will get replaced and have a char from a pre-determined string put in.

The problem that shows up on my Nexus 5 with at least Android 4.4, is that when the user presses period, it doesnt replace the period.

The code works perfectly from within the android studio emulator. The real methods that I feel like that aren't working properly is the onTextChanged method or the onKeyUp method. I'm not sure what to do here. I've written a lot of code that always works on the emulator and translates to equivilent success on real devices. What do?

the code is on a pastebin: http://pastebin.com/iupRJpZi

I have an issue that none of my developers can seem to solve which is as follows:

Issue Details:

  1. Issue is with Thumbnails of animation files not displaying;
  2. Issue is happening in BOTH our Ruby on Rails web application as well as our Android Application
  3. What's displaying and what's NOT displaying:
    { Animations created in AE in 2014 render/display animation thumbnails no issues; Animations created in AE in 2015 using IDENTICAL software, process, etc. do NOT render/display animation thumbnails.}

screenshot of one thumbnail displaying and one not displaying although they're from the same method and software

I already have a controller in my app maniefiesto.xml.

android:name=".b.app.AppController"

As I include parse?.

Thank you very much for your help. Cheers

Me and another programmer are attempting to set up a collaborative project online. One will be developing the front end part of the website (HTML/JavaScript) and another will be developing the back end (PHP Laravel / JavaScript / MySql).

The question I am asking is which software development process model should we use for a collaborative project between two developers online.

We are using git Github to collaboratively work on the project.

Also we need to find a way of communicating over something more than email to develop the application itself. Could anyone recommend a software or tool we could use.

i'm making simple application that store and retrieve data in database, i can store a data but i'am having a problem in retrieving on it, i want to retrieve the data and display it on TextView:

Here is my MySQLiteHelper.java

public class MySQLiteHelper extends SQLiteOpenHelper {

    private static final int DATABASE_VERSION = 1;
    private static final String DATABASE_NAME = "test";
    private static final String DATABASE_TABLE = "test_table";
    private static final String CREATE_TABLE = "CREATE TABLE " + DATABASE_TABLE + " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER)";

    public MySQLiteHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {   
        db.execSQL(CREATE_TABLE);
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
        this.onCreate(db);
    }

    //Table Columns names
    private static final String KEY_ID = "id";
    private static final String KEY_NAME = "name";
    private static final String KEY_AGE = "age";

    //This will store data and this is OK
    public void addNameAndAge(ReturningClass sample) {
            SQLiteDatabase db = this.getWritableDatabase();
            ContentValues values = new ContentValues();
            values.put(KEY_NAME, sample.getName());                                                             
            values.put(KEY_AGE, sample.getAge()); 
            db.insert(DATABASE_TABLE, null, values);
            db.close();
    }

    //This will retrieve data, and this is my problem
    public String[] getNameAndAge(){
        //I want to check first here if table has a value
        //if the table is empty then return 'No Data Yet' value
        //else then retrieve the data, but i don't know how to do that
        String selectQuery = "SELECT  * FROM " + DATABASE_TABLE;
        SQLiteDatabase db = this.getReadableDatabase();
        Cursor cursor = db.rawQuery(selectQuery, null);
                 String[] data = null;
        if (cursor.moveToFirst()) {
            do {
               // I don't know how i going to retrieve data here
            } while (cursor.moveToNext());
        }
        db.close();
        return data;
    }

}

}

Here is my ReturningClass.java model:

public class ReturningClass {

    private int id;
    private String nameThis;
    private String ageThis;

    public ReturningClass(){}

    public ReturningClass(String name, String age) {
        super();
        this.nameThis = name;
        this.ageThis = age;
    }

    public String getName() {
        return nameThis;
    }
    public String getAge() {
        return ageThis;
    }
    public int getId() {
        return id;
    }
}

and here is my MainActivity.java :

public class MainActivity extends Activity implements View.OnClickListener {

    public void onCreate(Bundle saveInstanceState) {
        super.onCreate(saveInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main_activity);

        db = new MySQLiteHelper(this);//DATABASE

        TextView nameTextView = (TextView) findViewById(R.id.nameId);
        TextView ageTextView = (TextView) findViewById(R.id.ageId);

        String[] dataGet = db.getNameAndAge();  
        if(dataGet == "No Data Yet"){
           //Some code here...
        }else{
           nameTextView.setText(dataGet[1]);
           ageTextView.setText(dataGet[2]);
        }

} }

I am very new in android developing so any helped will be appreciated. Thank you!

What is a good laptop for web design under $500? I'm getting paid $500 for developing a web site, and I want to buy a new laptop with the money. Right now I have an Acer cb3-111 chrome book running chrubuntu.

Is it possible to keep running an app in background even when the app has been closed (killed with task manager)? I only found that there's 10min limit for that, but is there a way with no time limit? Thanks!

I'm creating a game using Swift and SpriteKit in Xcode 6.1 and I can't get AVAudioPlayer to initialize. I have an SKScene for my menu, and I want to run music in my "Sounds" folder called "menu.mp3." However, it crashes every time I run my game. My code is below:

let filePath:NSURL = NSURL(fileURLWithPath: "menu.mp3")!
var er:NSError?
let audioPlayer:AVAudioPlayer = AVAudioPlayer(contentsOfURL: filePath, error: &er)

if (er != nil) {
} else {
     audioPlayer.play()
}

I put this in my initializer right after my super.init call. The error I get follows:

fatal error: unexpectedly found nil while unwrapping an Optional value

I've tried a lot of fixes, but I can't figure out what's going wrong. I've added the AVFoundation framework and imported it to this scene, but it continues to crash. Is there something wrong with my filePath that makes my audioPlayer not initialize or something? I've tried switching to other ways and making different parts optional, but I can't get it to work. Thanks!

Trying to open viewController that not as Launch.

in the didFinishLaunching..... method in the AppDelegate file I put this code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions{

if([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert) categories:nil];
    [application registerUserNotificationSettings:settings];
}else{
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeNone)];
}
if (launchOptions != nil) {
   // NSLog(@"Launched from push notification");
    UINavigationController *navController = (UINavigationController *)self.window.rootViewController;
    NewNotification *notificationViewController = [[NewNotification alloc] init];
    [navController.visibleViewController.navigationController pushViewController:notificationViewController animated:YES];
}
return YES;

}

when I send push notification and tap on it, its open the app and then crash.. what to do??

The user controls a snake moving on the surface of a sphere. I have the camera and the head of the snake attached to an imaginary sphere the same size as the visible one:

    headNode.addChildNode(cameraNode)
    controlNode.addChildNode(headNode)
    scene.rootNode.addChildNode(controlNode)

The user taps two buttons to rotate the snake left and right. I use some basic trig to convert this "2D" rotation into its components which I use to rotate the controlNode every frame:

    velocity.x = cos(rotation)
    velocity.y = sin(rotation)

    controlNode.eulerAngles.x += velocity.x
    controlNode.eulerAngles.y += velocity.y

This works very smoothly when moving over the majority of the sphere but at the two poles of the sphere (along the y axis) the snake behaves strangely. Here is a gif that shows the normal movement along the majority of the sphere and then the strange movement at the poles:

the gif was too large to upload so it is on imgur

The way it moves is like it bounces off the poles and I cannot for the life of me work it out. If anyone has a suggestion of an easier way to do the task it would be much appreciated!

So I am still pretty new to ios programming but I am trying to convert an XIB based application that was designed for ipad, so that it can work on iphone. I wanted to create a universal app view http://www.appcoda.com/ios-univeral-app-tutorial/ however this only works with storyboards as far as I can tell. So what is the easiest way to do this? covert all existing XIB (about 30) to storyboards? or is there any easier way. I simply want the iphone version to look EXACTLY the same as the ipad version. Right now it is giant and looks terrible, you can only see the top left third of the app.

I am trying to click on any element in the Appium inspector simulator but when highlighting the element and clicking on the tab button it seems like that the tab button just refreshing the app , can any one help me with that i am using Appium V 1.3.4 .