My friend release paid app application in apple store.

I buy that application in apple store, paid money and download it. Everything was Ok. But when I check my credit card details apple did not get application money. (I added my credit card and apple get only small money from it. I think it was for to check credit card valid or not)

Is it normal? I mean apple will get money later or something going wrong?

I am using the child added function of Firebase to show new user posts as they are added. For all the posts added before the user views the controller, the collection view properly loads the data. Anything added in real time after the user is in the view returns nil for all the values in the struct.

    let query = ref.child("AllPosts").child(selectedPlace).queryLimitedToLast(10)

    handle = query.observeEventType(.ChildAdded, withBlock: { (snap) in

            if snap.exists() {


                let postInfo = PostStruct(snap: snap)
                //when breakpointing this line below it returns nil values for the newly added post
                self.regionPosts.append(postInfo)
                self.regionPosts.sortInPlace({$0.timeDifference < $1.timeDifference})



                dispatch_async(dispatch_get_main_queue(), {
                    self.collectionView?.reloadData()
                })
            }

This is the code for the struct that I am passing the snapshot to properly assign the values to my model

    struct PostStruct {
var displayName: String?
var userComment: String?
var timeDifference: NSTimeInterval?
var timeElapsed: String?
var locationName: String?
var colorTag: Int?
var color: UIColor?

init(snap: FIRDataSnapshot) {
    let snapshot = snap.value as! NSDictionary

    userComment = snapshot["userComment"] as? String
    displayName = snapshot["username"] as? String
    locationName = snapshot["locationName"] as? String
    colorTag = snapshot["tag"] as? Int
    if let setTag = colorTag {
        color = Helper.addColorToTag(setTag)
    }

    let timeStamp = snapshot["checkTime"] as? NSTimeInterval


    if let setTimeStamp = timeStamp {
        let setDate = NSDate(timeIntervalSince1970: setTimeStamp/1000)
        let interval = fabs(setDate.timeIntervalSinceNow)
        timeDifference = interval
        var diff = Helper.findTimeElapsed(setTimeStamp)
        if diff == "0m" {
            diff = "Now"
        }
        timeElapsed = "\(diff)"

    }


}

}

What would be different about the newest retrieved real time post with a child added function? Thanks in advance as I am not sure what is causing the problem

I am trying to add an option so that while pressing the share button of a PDF file it'll suggest opening with my app. Like this:

enter image description here

Currently I don't have any idea how to do it properly. And how to recieve it on my app. Any suggestions will help. Thanks in advance.

Using swift, I am making an app that has access to the Apple Music app on the device and I can select the music files from my app. What do I need to do to make this work.

I am building an app to capture image(video) using UIImagePickerController. As my requirement is concerned I want to disable only the Rear/Front camera switching control. I tried the following code,

showsCameraControls=NO;

But it cancels all the controls like focus, flash. Can anyone suggest any solutions to disable rear/front switching control in UIImagePicker?

I have question(s) related to Android Doze Mode (Android N [deep doze] and M). As per Android official documentation once device enters doze mode, it stops receiving location updates either via GPS or Network.

And to exit doze mode, either screen turns on or power plugged in. But how about

1) In doze mode if device is moved but screen remains off. Will device exit the doze mode for movement?

2) In Doze mode are sensors such as Gyro or accelerometer are they working or also stopped?

I understand we can setup a time for our app update to go live using timed publishing.

I am also wanted to update the 'Store Listing' info at the same time (i.e. update the screenshots of the app, and update the description) will this information also be published at the same time of the app using timed publishing? Or does this update go live straight away. Thanks for the help

I'm trying to add a WHERE clause or a filtering feature in the onCreateLoader to populate values in a ListView. I think my syntax is correct, but every time the app loads to that activity, it crashes.

Here is my code:

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    String courseQry = DBOpenHelper.COURSE_TERM + "=?";
    String[] courseArg = {"Term 1"};
    return new CursorLoader(this, CourseProvider.COURSE_CONTENT_URI,
         null,courseQry, courseArg, null);
}

When i tried adding a question mark after the equal sign, I am able to load the activity, but nothing is being shown in the ListView.

I'm not really sure what to do?

Hello i recently installed Android Studio 2.2 and while downloading components, i always got this error message

Warning: An error occurred while preparing SDK package Android Support Repository: Cannot download 'https://dl.google.com/android/repository/android_m2repository_r39.zip': Read timed out

i tried to reinstall it and started from the beginning but no changes happened.

i am running windows 10.

I am working on a project where user request for our valet services and on the other end valet accepts request.

I am using using firebase as backend and on request customer uid is save on 'request' child.

When valet accepts request, customer uid should move from 'request' node to 'on progress' node.

How can i do that?

I have a RecyclerView and a Fab menu in the lower corner.

Press on the EditText inside one of the rows of the RecyclerView and the keyboard comes up. Enter values and press enter to move to the next row. The window mode for this activity is AdjustPan so the numbers are visible with the keyboard.

However after the last row the focus seems to switch over to the Fab, where pressing enter toggles it to open or close. But I want the keyboard / focus to simply go away after the final row and not have Android focus on the Fab.

How do I do this?

I created a costum Toolbar with a Backarrow as an ImageButton. I want to get a reference to this Button but it always returns Null. Two Hours ago it worked, but i changed the code and i don't know what is wrong now.. it would be great if you could help me!

MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

// Always cast your custom Toolbar here, and set it as the ActionBar.
Toolbar tb = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(tb);

// Get the ActionBar here to configure the way it behaves.
ActionBar ab = getSupportActionBar();
//ab.setHomeAsUpIndicator(R.drawable.ic_menu); // set a custom icon for the default home button
ab.setDisplayShowHomeEnabled(true); // show or hide the default home button
ab.setDisplayHomeAsUpEnabled(true);
ab.setDisplayShowCustomEnabled(true); // enable overriding the default toolbar layout
ab.setDisplayShowTitleEnabled(true); // disable the default title element here

ImageButton backar = (ImageButton) findViewById(R.id.backarrow);
backar.setOnClickListener(this);
backar.setOnClickListener(new View.OnClickListener()
{
    public void onClick(View arg0)
    {
        MainActivity.super.onBackPressed();
    }
});

activity_main.xml

?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true"
    tools:context="com.example.marc.stadtcoach.FreeActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />
    </android.support.design.widget.AppBarLayout>

    <RelativeLayout
        android:id="@+id/activity_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFFFFF"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:context="com.example.marc.stadtcoach.MainActivity">

        <Button
            android:id="@+id/zeitspiel"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp"
            android:background="@drawable/lockedroundbutton"
            android:text="Zeitspiel"
            android:textColor="#FFFFFF"
            android:layout_below="@+id/spiel"
            android:layout_alignLeft="@+id/spiel"
            android:layout_alignStart="@+id/spiel"
            android:layout_alignRight="@+id/spiel"
            android:layout_alignEnd="@+id/spiel" />

        <Button
            android:id="@+id/statistik"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="26dp"
            android:background="@drawable/roundbutton"
            android:text="Statistik"
            android:textColor="#FFFFFF"
            android:layout_below="@+id/zeitspiel"
            android:layout_alignLeft="@+id/spiel"
            android:layout_alignStart="@+id/spiel"
            android:layout_alignRight="@+id/zeitspiel"
            android:layout_alignEnd="@+id/zeitspiel" />


        <TextView
            android:id="@+id/coinView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="0"
            android:textSize="16dp"
            android:layout_alignBottom="@+id/imageView1"
            android:layout_alignRight="@+id/spiel"
            android:layout_alignEnd="@+id/spiel" />

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/coin"
            android:layout_marginRight="10dp"
            android:layout_marginEnd="10dp"
            android:layout_alignParentTop="true"
            android:layout_toLeftOf="@+id/coinView"
            android:layout_toStartOf="@+id/coinView" />

        <Button
            android:id="@+id/spiel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="108dp"
            android:background="@drawable/startbutton"
            android:text="Lernspiel"
            android:textColor="#FFFFFF"
            android:layout_below="@+id/coinView"
            android:layout_centerHorizontal="true" />
    </RelativeLayout>

</android.support.design.widget.CoordinatorLayout>

The costum toolbar menu_back.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
    app:layout_scrollFlags="scroll|enterAlways"
    app:layout_collapseMode="pin">
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">        

        <!-- This is a custom left side button -->
        <ImageButton
            android:id="@+id/backarrow"
            android:layout_width="?attr/actionBarSize"
            android:layout_height="?attr/actionBarSize"
            android:layout_marginRight="?attr/actionBarSize"
            android:layout_gravity="start|center_vertical"
            android:visibility="visible"
            android:src="@drawable/backarrow"
            style="@style/Widget.AppCompat.ActionButton" />

    </FrameLayout>
</android.support.v7.widget.Toolbar>

And finally the error message

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.example.marc.stadtcoach, PID: 386
                  Theme: themes:{default=overlay:grovelet.s7.galaxys7.galaxy.launcher.theme, iconPack:grovelet.s7.galaxys7.galaxy.launcher.theme, fontPkg:grovelet.s7.galaxys7.galaxy.launcher.theme, com.android.systemui=overlay:grovelet.s7.galaxys7.galaxy.launcher.theme, com.android.systemui.navbar=overlay:grovelet.s7.galaxys7.galaxy.launcher.theme}
                  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.marc.stadtcoach/com.example.marc.stadtcoach.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageButton.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
                      at android.app.ActivityThread.-wrap11(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:148)
                      at android.app.ActivityThread.main(ActivityThread.java:5461)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                   Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageButton.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                      at com.example.marc.stadtcoach.MainActivity.onCreate(MainActivity.java:44)
                      at android.app.Activity.performCreate(Activity.java:6251)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510) 
                      at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:148) 
                      at android.app.ActivityThread.main(ActivityThread.java:5461) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
I/Process: Sending signal. PID: 386 SIG: 9
Application terminated.

The problem is that

ImageButton backar = (ImageButton) findViewById(R.id.backarrow);

in my MainActivity.java returns null.

I would be very happy if there is someone who can help me!

I have a problem with my launcher icon. I want to display the same icon at multitasking windows, and also at notifications.

Any thoughts?

notification icon

Tryied already that codes .setSmallIcon(R.drawable.my_small_icon); Or .setSmallIcon(R.mipmap.ic_launcher);

With no luck

I need a system that will execute this code every second. I've been looking for a while and still can't find any ways that work. I'm quite new to Java programming and programming for android so any help will be greatly appreciated.

    Values n = new Values();

        double num = n.getNum();
        double adder = n.getAdder();
        if(adder>=1) {
            num += (adder * 0.1);
        }
        TextView t = (TextView) findViewById(R.id.textView1);
        t.setText(num + "");

        n.setNum(num);

Also I'm importing values from a Values class that looks like this,

    package com.example.durtle02.durtle02;



    public class Values {
double num;
double cost = 30;
double adder;

public double getNum() {
    return num;
}

public void setNum(double num) {
    this.num = num;
}

public double getCost() {
    return cost;
}

public void setCost(double cost) {
    this.cost = cost;
}

public double getAdder() {
    return adder;
}

public void setAdder(double adder) {
    this.adder = adder;
}

}

I'm trying to get a json from a server and deserialize it, but I try probelas with unescaped control characters. My code is as follows ...

let urlFinal = "http://000.0000.000.000:8080"
        let jsonUrl = urlFinal
        let session = NSURLSession.sharedSession()
        let shotsUrl = NSURL(string: jsonUrl)

        let task = session.dataTaskWithURL(shotsUrl!) {data, response, error in
            guard data != nil else {
                falha()
                return
            }

            //let json = JSON(data: data!)
            //print(json["ServicoCliente"][0]["id"])

            do {
                let jsonData = try NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableContainers )
                let J = jsonData as! NSDictionary
                print(jsonData)
                let us = J["ServicoCliente"]
                print(us)
                dispatch_async(dispatch_get_main_queue(),{
                    sucesso()
                });
            } catch _ {
                falha()
            }
        }
        task.resume()

and I also tried this using Alamofire 3.0:

Alamofire.request(.GET, "http://000.000.000.000/", parameters: nil)
    .responseJSON { response in
        debugPrint(response)     // prints detailed description of all response properties

        print(response.request)  // original URL request
        print(response.response) // URL response
        print(response.data)     // server data
        print(response.result)   // result of response serialization

        if let JSON = response.result.value {
            print("JSON: \(JSON)")
        }
}

And get this error:

Unescaped control character around character 263

How can I remove characters without escape?

I use X-Code 7.3.1 and Swift 2.3

I have a PNG image with a transparent area and background.

enter image description here

I want to use it as SKTexture for my SKSpriteNode, but before it should be colored in some UIColor.

I'm trying to achieve this with

func colorImage(origImage: UIImage, color: UIColor) -> UIImage {
    UIGraphicsBeginImageContextWithOptions(origImage.size, true, 0)
    let context = UIGraphicsGetCurrentContext()
    context?.setFillColor(color.cgColor)
    context?.fill(CGRect(origin: CGPoint(x: 0, y: 0), size: origImage.size))
    let flipVertical = CGAffineTransform.init(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: origImage.size.height)
    context?.concatenate(flipVertical)
    context?.draw(origImage.cgImage!, in: CGRect(origin: CGPoint(x: 0, y: 0), size: origImage.size))
    let image = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()
    return image!
}

But it colors the background too:(

enter image description here

How can I color only the cloud?

Any help is appreciated!

I am working on a class scheduling problem. For part of this, I am writing a java class called block that has 2 x 5 array which represents a two hour block which is a block of time for class to be scheduled in a university. For example a two hour block might represent time from 8:00 am to 10:00 am for five days. course will be put on the 2d array by following ways.

  1. Either a class meets 3 times per week, Therefore they will be scheduled on MWF(Monday, Wednesday, Friday
  2. Or they meet two times a day, so the course will be scheduled on T and TH (Tuesday, Thursday)
  3. Or they might decide to meet once a week. In this case, they can be any one of the M,T,W,TH, F.

Here is an example of class that meets monday wednesday and friday for 2 hours each day.

M T W Th F

[[Chem, null, Chem, null, Chem],

[Chem, null, Chem, null, Chem]]

If a class is 4 credit class and they decide to meet for MWF then, it takes 1 hour 15 minute each day, In this case I still need to use 2 hour block. I am worried that this might create unused holes in the schedule . Right now I am using one hour and 2 hour block to represent courses. Do you guys have idea on better way to represent class block? I will appreciate any suggestions.

i am a 17 year old boy in high school currently living in Toronto , i have been having question for my future carrier and have been lead to computer engineering and software,because of the lack of time i have to learn the courses from scratch i have been thinking about teaching my self and i do not know where to start and how . please help me to make my path clearer thank you . And by the way can you please explain the differences between computer engineering and software engineering .

Say I have the following ER diagram:

enter image description here

Enforcing the mandatory participation constraint at the one end is easy, I simply make the foreign key (school_id) in Student NOT NULL.

But how can I enforce the mandatory participation constraint at the many end (each School must at least have one Student), that is, how can I prevent something like this:

enter image description here

If I inserted a School row first, it will obviously have no Students.

And I also can't insert a Student row first with a school_id that doesn't exist in the School table (referential integrity constraint will prevent it) and then insert a School row (with the same school_id).

Note: I am using MySQL.

Realm Version: 2.1.1

I have a fragment and in it's onCreate() I register a RealmChangeListener. However, when my object is updated, the RealmChangeListener's onChange() never fires.

Actually, that is a lie, for some strange reason if I clean install my app it will work a few times before not working at all for all until I uninstall/reinstall the app again. No idea why maybe listeners would unregister?

I know for a fact those Realm operations are writing to Realm because if I restart my app, the UI definitely displays those new changes.

Feeling a little confused here, I hope I am not doing something wrong:

public class ProfileFragment extends Fragment {

    private Realm mRealm;
    private RealmChangeListener mRealmChangeListener;

    @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            mRealm = Realm.getDefaultInstance();

            // Get user from Realm
            RealmQuery<User> query = mRealm.where(User.class);
            User user = query.findFirst();

            updateUI(user);

            mRealmChangeListener = new RealmChangeListener<User>() {
                @Override
                public void onChange(User user) {
                    updateUI(user);
                }

            };

            user.addChangeListener(mRealmChangeListener);

        }

        // Todo:
        // Unregister listeners + realm in OnDestroy();
}

I want to implement Facebook login with my app where I initiate the dialogue through my application, but all of the authentication logic goes through the server. All I want the application to do is give the user a "Sign in Through Facebook" button. The user presses this button, and thereafter I'd like all authorization to go through the server where it's handled by Passport's Facebook module and my strategy. In the end I would pass back my client some credentials, then shift views to my "home" screen.

With a browser-based application, this would be as simple as setting the "href" value of the login button to a route that calls the "passport.authenticate", and setting the redirect url to a route that upon success, would render a successful login view through the view engine.

However I'm unclear of how to integrate this server code with an iOS application as iOS views are can't be rendered by the server. I can get the login button to send a request to my server to a route that calls "passport.authenticate('facebook')", but from there I'm unsure how to coordinate server responses with what happens on the client (views switching between a FB window and the app, redirecting them to one view if succesful and back to login if not).

How could this be implemented? If I'm thinking about OAuth incorrectly, what would your recommendations be for changing my auth flow? Any input is appreciated.