I'm working on a project which revolves around a database of about 750.000 entities. Let's just say these entities are musical works. Each musical work is associated with an album, one or more composers and some other entities.

The business who owns this database has bought services from other providers which requires the business to "notify" these providers when a musical work gets created, updated or deleted in the database.

An important note here is that any given musical work is considered updated if the entity itself (the musical work) or any entity which the musical work is associated with gets updated. In other words, if the composer of the musical work "Air On The G String" was renamed from "Bacch" to "Bach" - then that musical work (and all other tracks related to that composer) should be considered updated.

The entities are stored in a relational database, and there is no built-in functionality as such in the database which allows us to keep track of which entities have been created, updated or deleted. It is also a requirement to not rely on any such functionality. Furthermore, the graph of entities which makes up a single musical work can grow quite large. I don't think creative SQL statements would be the way to go here to somehow discover created, updated or deleted entities.

What I've been thinking is to set up a job which once a day simply iterates over all musical works and creates a hash for each and every one. I've so far come to the conclusion that for any given musical work in the database, the job will have to pull the musical work itself from the database along with associated entities (album, shares, composers etc) and generate a hash based on relevant fields.

enter image description here

I believe that a hash can be generated by concatenating track fields, share fields, composer fields and album fields - and then create a hash based on that (long) string.

The generated hash for each musical work will then be stored in a separate database, and by doing it this way the job can compare musical works (through the generated hashes) for each run vs. the previous run.

This way, the job will be "data store agnostic" (the entities can come directly from the database, from a webservice or something else) and the actual state of the last replicated version of any given musical work will be safely stored as a hash.

Now, I'd like a sanity check on this design. Does this seem to be a fair way to solve this task or am I complicating things?

I have a MySQL database hosted online and wanting to pull data using my application layer which are iOS, android, and webapp. I read somewhere that I can write a RESTful API in the middle.

Can I write RESTful API in PHP or swift?

how does it work? database - RESTful API ->iOS, android, and webapp?

Do I use JSON file to communicate with the API if im programming in iOS?

I just want to learn a better architecture of my web services, any book suggestions?

In my app, i am sending data from ios app to watch app, which is successfully being sent. But i want the same data to be displayed in table view which is displayed in the main view of watch app. i.e 4 labels and 1 image

storyboard image of my watch app

output when running app main View output when running app Table View Source code for watch side main View is:

 class InterfaceController: WKInterfaceController, WCSessionDelegate {

    var session: WCSession!

    var MessageData = NSMutableDictionary()

    @IBOutlet var watch_displayImage: WKInterfaceImage!
    @IBOutlet var watch_ticket_category: WKInterfaceLabel!
    @IBOutlet var watch_ticketType: WKInterfaceLabel!
    @IBOutlet var watch_ticketTime: WKInterfaceLabel!
    @IBOutlet var watch_ticketDate: WKInterfaceLabel!

    override func awakeWithContext(context: AnyObject?) {
        super.awakeWithContext(context)

        if WCSession.isSupported()
        {

            session = WCSession.defaultSession()
            session.delegate = self
            session.activateSession()

        }

           }

    override func willActivate()
    {

        super.willActivate()

    }

    func session(session: WCSession, didReceiveMessage message: [String : AnyObject], replyHandler: ([String : AnyObject]) -> Void)
    {

        MessageData = NSMutableDictionary(object: message, forKey: "data")

        print("\(MessageData)")

        let imgdata = MessageData["data"]!["Watchdat"]!!["image_data"] as! NSData

        watch_ticket_category.setText("\(MessageData["data"]!["Watchdat"]!!["ticket_category"] as! String)")
        watch_displayImage.setImageData(imgdata)
        watch_ticketType.setText("\(MessageData["data"]!["Watchdat"]!!["ticket_type"] as! String)")
        watch_ticketTime.setText("\(MessageData["data"]!["Watchdat"]!!["time"] as! String)")
        watch_ticketDate.setText("\(MessageData["data"]!["Watchdat"]!!["date"] as! String)")



    }

 Source code for watch app(tableView) tried so far is:



 var dic = NSMutableDictionary()
    let array_data = NSMutableArray()
var session: WCSession!
   override func awakeWithContext(context: AnyObject?)
   {
        super.awakeWithContext(context)
    if WCSession.isSupported()
    {

        session = WCSession.defaultSession()
        session.delegate = self
        session.activateSession()

    }


     loadTableData()

    }

func loadTableData()
{
    historyTable.setNumberOfRows(array_data.count, withRowType: "cell")

    for i in 0..<array_data.count
    {
        if let cell = historyTable.rowControllerAtIndex(i) as? HistoryCell
        {
            let dic = array_data[i] as! NSMutableDictionary
            let imgdata = dic["data"]!["Watchdat"]!!["image_data"] as! NSData
            cell.image.setImageData(imgdata)
            cell.category.setText("\(dic["data"]!["Watchdat"]!!["ticket_category"] as! String)")
            cell.type.setText("\(dic["data"]!["Watchdat"]!!["ticket_type"] as! String)")
            cell.date.setText("\(dic["data"]!["Watchdat"]!!["date"] as! String)")
            cell.time.setText("\(dic["data"]!["Watchdat"]!!["time"] as! String)")


        }


    }

I had enable a All Exceptions break point in my project.

But the UIApplicationMain() function always trigger the break point when the app launching. I think there was no exceptions here because if I click the Next Button twice, the app will launch successfully.

I have tried commenting the code in the AppDelegate, but it does't work.

I have a UILabel which do not show complete text due to limited frame (frame can't be changed); ellipsis is shown in the end.

I want to implement a feature wherein on tap and hold on UILabel, a pop-over with a magnifier appears and user is allowed to move his finger left/right to see the complete text. Release the tap will dismiss this custom view.

Has anyone tried something like this before? Please point me to any already available custom implementation. Thanks a lot!

I am heading a problem when developing an app. I would like to implement recording function in UIPageViewController. And my storyboard is like this : ShowViewController embed pageViewController embed ContentViewController.

But every time that I change the page, recorder will reset again so that user can't record when they read whole book at same time. Please help me with this. How can I implement recording function when user reading book at same time?

The crash is reproducible in an iOS 9.0.x device via opening this official demo page from app with UIWebView (like Facebook Messenger)

I'm using YouTube iFrame player based on this reference in my iOS UIWebView, however, from 9/2, it starts crashing the app (iOS 9.0.x ONLY) with stack such as below:

Crashed: JavaScriptCore::Marking

0  JavaScriptCore                 0x1859f65b0 JSC::JSEnvironmentRecord::visitChildren(JSC::JSCell*, JSC::SlotVisitor&) + 224
1  JavaScriptCore                 0x1859f65ec JSC::JSEnvironmentRecord::visitChildren(JSC::JSCell*, JSC::SlotVisitor&) + 284
2  JavaScriptCore                 0x1855c34bc JSC::SlotVisitor::drain() + 300
3  JavaScriptCore                 0x1855c446c JSC::SlotVisitor::drainFromShared(JSC::SlotVisitor::SharedDrainMode) + 288
4  JavaScriptCore                 0x1858e4bd0 JSC::GCThread::gcThreadMain() + 120
5  JavaScriptCore                 0x1855bb4e4 WTF::threadEntryPoint(void*) + 212
6  JavaScriptCore                 0x1855bb3f4 WTF::wtfThreadEntryPoint(void*) + 24
7  libsystem_pthread.dylib        0x199e87b3c _pthread_body + 156
8  libsystem_pthread.dylib        0x199e87aa0 _pthread_body + 154
9  libsystem_pthread.dylib        0x199e85030 thread_start + 4

Since that it's reproducible in iOS 9.0.x device with official demo page, I assume that there may be something wrong about YouTube iFrame player changes on 9/2.

Does anyone have any suggestions about what to do about it?

According to facebook version history, they no longer support api v2.0 as of August 7 2016. What will happen to live apps using api v2.0 ? Will they stop working ?

I'm a big noob when it comes to Swift and Xcode. I'm making an app and I want to utilize Chameleon Framework in it. The instructions in the Chameleon GitHub are sparse but they say that if I'm not using Carthage or CocoaPod (my case) I need to manually copy the Chameleon folder to my project. I proceed to do that successfully.

Then it says I must copy an extra file too, called "ChameleonShorthand.swift" and I proceed to copy it.

Then, to initialize the framework, I'm supposed to import them on each of my View Controllers.

I try doing that, but no matter which way I try to syntax it, errors occur. When I import, it says "there is no such module" or "expected expression"! Plus when I try building the program lots of errors appear in that extra file I had to put (read the tutorial I hyperlinked)!

Errors that appear

What exactly should I do? Do I have to create a Bridging Header? Can you explain to me like I'm 5 years old?

ps: unfortunately I can't add more images, I wanted to show thoroughly to you guys where I put the files and how I typed the imports.

I am doing a project which needs to show the photos in the system album. I use a ViewController with a UICollectionView to show all photos get from the ViewModel. The ViewModel will get the photos in the viewDidLoad method.

But when there are more than a thousand photos in the album, the loading speed will be really slow. I do not want to set the PHImageRequestOptions.synchronous to No because it will make me get an unclear thumb image. How to solve this problem?

Here is the code:

- (void)enumerateAssetsInAssetCollection:(PHAssetCollection *)assetCollection original:(BOOL)original{
    NSLog(@"%@", assetCollection.localizedTitle);

    PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];

    options.synchronous = YES;
    options.resizeMode = PHImageRequestOptionsResizeModeExact;
    options.deliveryMode = PHImageRequestOptionsDeliveryModeOpportunistic;
    options.normalizedCropRect = CGRectMake(0, 0, kSCREEN_WIDTH/3, kSCREEN_WIDTH/3);

    PHFetchResult<PHAsset *> *assets = [PHAsset fetchAssetsInAssetCollection:assetCollection options:nil];
    for (PHAsset *asset in assets) {
         CGSize size = original ? CGSizeMake(asset.pixelWidth, asset.pixelHeight) : CGSizeMake(kSCREEN_WIDTH/3, kSCREEN_WIDTH/3);

         [[PHImageManager defaultManager] requestImageForAsset:asset targetSize:size contentMode:PHImageContentModeAspectFill options:options resultHandler:^(UIImage * _Nullable result, NSDictionary * _Nullable info) {
            NSLog(@"%@", result);
            [self.photoArray addObject:result];
         }];
    }
}

I am trying to put a ripple simulation ontop of an already buisy app. Right now the cpu runs at about 11ms on the lowest processors. All the code in it so far runs on the main thread.

I am hoping that it is possible to put the ripple simulation entirely on another thread.

The simulation is based on the apple GLCameraRipple project. Basically it creates a tesselated rectangle, and calculates the texture coordinates. So in an ideal world the texture coordinates, and ripple simulating arrays would all be on a different thread.

The update function I am working with right now looks like this. It does sorta leverage GCD however it gains no speed from doing so due to to the sync. Without the sync however the app would crash because swift arrays are not thread safe.

var rippleTexCoords:[GLfloat] = []
var rippleSource:[GLfloat] = []
var rippleDest:[GLfloat] = []
func runSimulation()
    {
        if (firstUpdate)
        {firstUpdate = false; Whirl.crashLog("First update")}

        let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
        let block1: (y: size_t) -> Void = {
            (y: size_t) -> Void in

            objc_sync_enter(self)
            defer { objc_sync_exit(self) } // */ This will actually run at the end

            let pw = self.poolWidthi
            for x in 1..<(pw - 1)
            {
                let ai:Int = (y    ) * (pw + 2) + x + 1
                let bi:Int = (y + 2) * (pw + 2) + x + 1
                let ci:Int = (y + 1) * (pw + 2) + x
                let di:Int = (y + 1) * (pw + 2) + x + 2
                let me:Int = (y + 1) * (pw + 2) + x + 1

                let a = self.rippleSource[ai]
                let b = self.rippleSource[bi]
                let c = self.rippleSource[ci]
                let d = self.rippleSource[di]

                var result = self.rippleDest[me]
                result = (a + b + c + d) / 2.0 - result
                result -= result / 32.0

                self.rippleDest[me] = result
            }
            //Defer goes here
        }

        dispatch_apply(Int(poolHeighti), queue, block1);

         /*for y in 0..<poolHeighti {
            block1(y: y)
         }*/


        let hm1 = GLfloat(poolHeight - 1)
        let wm1 = GLfloat(poolWidth - 1)
        let block2: (y: size_t) -> Void  = {
            (y: size_t) -> Void in

            objc_sync_enter(self)
            defer { objc_sync_exit(self) } // */

            let yy = GLfloat(y)
            let pw = self.poolWidthi
            for x in 1..<(pw - 1)
            {let xx = GLfloat(x)
                let ai:Int = (y    ) * (pw + 2) + x + 1
                let bi:Int = (y + 2) * (pw + 2) + x + 1
                let ci:Int = (y + 1) * (pw + 2) + x
                let di:Int = (y + 1) * (pw + 2) + x + 2

                let a = self.rippleDest[ai]
                let b = self.rippleDest[bi]
                let c = self.rippleDest[ci]
                let d = self.rippleDest[di]

                var s_offset = ((b - a) / 2048)
                var t_offset = ((c - d) / 2048)

                s_offset = (s_offset < -0.5) ? -0.5 : s_offset;
                t_offset = (t_offset < -0.5) ? -0.5 : t_offset;
                s_offset = (s_offset >  0.5) ?  0.5 : s_offset;
                t_offset = (t_offset >  0.5) ?  0.5 : t_offset;

                let s_tc = yy / hm1
                let t_tc = xx / wm1

                let me = (y * pw + x) * 2
                self.rippleTexCoords[me + 0] = s_tc + s_offset
                self.rippleTexCoords[me + 1] = t_tc + t_offset

            }
        }
        dispatch_apply(poolHeighti, queue, block2)

        /* for y in 0..<poolHeighti {
         block2(y: y)
         } *///

        let pTmp = rippleDest
        rippleDest = rippleSource
        rippleSource = pTmp
    } 

Is there any way to force this code to constantly run on a different thread? Or somehow get it to go faster?

I dont konw if it was possible but if it is I would have these arrays on the following thread:

Main:

  • rippleVertices
  • rippleIndices

Secondary: (These are never read or written on the main thread)

  • rippleSource
  • rippleDest

On both threads:

  • rippleTexCoords (Read on main thread, written on secondary thread)

If these conditions are followed then the runSimulation method could possibly be run on the second thread without issue.

I want get a image use imageWithContentsOfFile from a path,but it return nil.Then i try imageWithData,it return nil,but the data not nil. Please help me,thank you very much! The path like "/var/mobile/Containers/Data/Application/F865E931-B673-4295-8AC3-B5C3560A10D6/Library/Caches/pic/0513041abff0edbb0e909a1364abe2ed.jpg" By the way, on the simulator will not appear this kind of circumstance, returns nil case only on the real machine.

NSFileManager * fileManager = [NSFileManager defaultManager];
        BOOL bl1 = [fileManager fileExistsAtPath:strDestinationPath];
        if (bl1 == NO)
        {
            [request setDownloadDestinationPath:strDestinationPath];
            [request setCompletionBlock:^(void){
                UIImage * image=[UIImage imageWithContentsOfFile:strDestinationPath];
                [PictureDict setValue:image forKey:strGUID];
                [self.delegate DownloadPictureIsOver:YES RequestID:RequetID];
            }];

            [request setUserInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%@",strGUID] forKey:@"name"]];
            [networkQueue addOperation:request];
        }
        else
        {
            NSData *imageData = [NSData dataWithContentsOfFile:strDestinationPath];
           UIImage *image = [UIImage imageWithData:imageData];
            [PictureDict setValue:image forKey:strGUID];
        }

Last time, I am using ios 6. I have changed my minimum deployment target in project setting and cocoapod file.

platform :ios, '9.0'

I already clear cache like this.

rm -rf ~/Library/Caches/CocoaPods; rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*; pod deintegrate; pod setup; pod install;

But, why I always get this error ? How shall I do?

Specs satisfying the Realm (~> 1.0) dependency were found, but they required a higher minimum deployment target.

I am trying to write a program in Maple that compute all n-tuples where n is a positive integer that satisfy the following: For a fixed positive integer number N and for n>=j>i>=2, the first i-1 coordinates are all equal and N, the coordinates between ith and (j-1)th are either N+1 or N-1 and the rest of the coordinates are equal and N.

Any help would be great.

Let's say that we have a class PersonName and we throw an exception when some one try to create a instance of PersonName passing an invalid name to the constructor. Should the exception InvalidPersonName be expressed on the domain model? And if it should, how should it be represented?

I am using visual studio express 2013.

I am wondering is there panel where I can see the functions inside .vb file and navigate through it by clicking it.

For example, in MPLABX ide based on netBean platform provides window such as shown below

enter image description here

If i click on function name, the editor window changes to the implementation of the function.

Does VS provide similar functionality?

Ive been working on a simple app that has a feature where you can test your knowledge by answering multiple choice questions. After an answer is selected(by the radio button), i want to show either a check mark if the answer is correct, or an "X" if the answer is incorrect, to the right of the selected answer. For some reason, my code works perfectly for the first try, and then doesnt change anything when selecting other answers.

heres the code (its part of an adapter - child view)

 /**
 * Creates the View of group(parent) in the ExpandableListView
 *
 * @return the View of each parent in the List
 */
@Override
public View getGroupView(final int groupPosition, final boolean isExpanded, View convertView, final ViewGroup parent) {
    LayoutInflater inflater = LayoutInflater.from(context);
    View parentView = inflater.inflate(R.layout.custom_list_parent, parent, false);
    Question myQuestion = myList.get(groupPosition);
    //setting the text of each parent
    TextView singleTitle = (TextView) parentView.findViewById(R.id.title);
    singleTitle.setText(myQuestion.getQuestion());
    //handling the indicator
    ImageView indicator = (ImageView) parentView.findViewById(R.id.indicator);
    //if the list is expanded use arrow up, if not then use arrow down
    int imageResourceId = isExpanded ? android.R.drawable.arrow_up_float : android.R.drawable.arrow_down_float;
    //initial arrow
    indicator.setImageResource(imageResourceId);
    indicator.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            /**
             * Will expand and collapse groups depending on previous state
             * @param v the View from which the ClickListener was triggered
             */
            if (isExpanded) ((ExpandableListView) parent).collapseGroup(groupPosition);
            else ((ExpandableListView) parent).expandGroup(groupPosition, true);

        }
    });

    return parentView;


}

/**
 * Creates the View of child in the ExpandableListView
 * @return the View of each child in the List
 */
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
    LayoutInflater inflater = LayoutInflater.from(context);
    final View childView = inflater.inflate(R.layout.custom_list_child_questions, parent, false);
    handleRadioButtons(childView,groupPosition);
    return childView;
}

/**
 * Checks if the child can be selected/pressed as well
 *
 * @return whether the child is selectable or not
 */
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
    return false;
}


public void handleRadioButtons(View childView, int groupPosition) {
    final Question myQuestion = myList.get(groupPosition);
    RadioGroup group = (RadioGroup) childView.findViewById(R.id.buttonGroup);
    initializeButtons(childView);
    setButtonText(myQuestion);
    //if one of the buttons is pressed
    group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
        /**
         * Will expand and collapse groups depending on previous state
         * @param group the button group this ActionListener will operate on
         * @param checkedId the ID of the individual button that was pressed
         */
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            //get the index of the correct answer
            int indexAnswer = Integer.parseInt(myQuestion.getAnswer()) - 1;
            for (int i = 0; i < possibleAnswers.length; i++) {
                //if the button at position i was pressed
                if (checkedId == possibleAnswers[i].getId()) {
                    //if its the correct answer
                    if (i == indexAnswer)
                        possibleAnswers[i].setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.checkmark, 0);
                    else
                        possibleAnswers[i].setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.wrong, 0);

                } else {
                    possibleAnswers[i].setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
                }
            }
        }
    });

}

/**
 * Sets the text of each radio button as a possible answer
 * @param myQuestion the Question corresponding to the possible answers
 */
public void setButtonText(Question myQuestion) {
    for (int i = 0; i < possibleAnswers.length; i++) {
        possibleAnswers[i].setText(myQuestion.getPossibleAnswers()[i]);
    }
}

/**
 * Initializes the RadioButton array of possible answers
 * @param childView the View in which the radio buttons are defined
 */
public void initializeButtons(View childView) {
    //array of radioButtons, each button will correspond to a possible answer
    possibleAnswers[0] = (RadioButton) childView.findViewById(R.id.answer1);
    possibleAnswers[1] = (RadioButton) childView.findViewById(R.id.answer2);
    possibleAnswers[2] = (RadioButton) childView.findViewById(R.id.answer3);
    possibleAnswers[3] = (RadioButton) childView.findViewById(R.id.answer4);
}

}

and the xml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:background="#6495ED"
              android:layout_width="match_parent"
              android:layout_height="135dp">

    <RadioGroup
            android:id="@+id/buttonGroup"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

            <RadioButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="choice1"
                    android:drawablePadding="6dp"
                    android:textColor="#ffffff"
                    android:textSize="12dp"
                    android:id="@+id/answer1"/>


            <RadioButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="choice 2"
                    android:drawablePadding="6dp"
                    android:textColor="#ffffff"
                    android:textSize="12dp"
                    android:id="@+id/answer2"/>


            <RadioButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="choice 3"
                    android:drawablePadding="6dp"
                    android:textColor="#ffffff"
                    android:textSize="12dp"
                    android:id="@+id/answer3"/>

            <RadioButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="choice 4"
                    android:drawablePadding="6dp"
                    android:textColor="#ffffff"
                    android:textSize="12dp"
                    android:id="@+id/answer4"
            />

    </RadioGroup>

that's how the problem looks on the screen: problem

Any ideas? Please help!

The following is my hashmap.

private HashMap<String, Integer> details;
details = new HashMap<>();
details.put("coins", 0);
details.put("score", 0);
details.put("wins", 0);

The following is my get coins method

public int getCoinCount()
{
    if(details == null)
    {
        return 0;
    }
    return  details.get("coins").intValue();
}

Now when I run this I get a ClassCastException. The following is the code that is calling it.

int coins =  MyClass.getInstance().getCoinCount();

It says I can't cast a long to an integer! THERE WAS NEVER A MENTION TO A LONG TYPE! WHAT IS GOING ON?

I'm developing a simple chatting app on android studio using a code in GitHub and when fixing all errors I end with this one !!!

2016-09-06 03:30:33,565 [ 494519]   WARN - nal.AbstractExternalSystemTask - A problem occurred configuring root project 'Chat'. 
com.intellij.openapi.externalSystem.model.ExternalSystemException: A problem occurred configuring root project 'Chat'.
   at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:106)
   at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:158)
   at org.jetbrains.plugins.gradle.service.project.BaseGradleProjectResolverExtension.getUserFriendlyError(BaseGradleProjectResolverExtension.java:579)
   at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158)
   at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:405)
   at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:772)
   at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:752)
   at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:238)
   at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:112)
   at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:73)
   at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
   at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
   at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
   at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
   at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
   at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
   at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138)
   at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124)
   at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:419)
   at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:500)
   at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
   at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
   at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
   at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
   at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
   at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   at java.lang.Thread.run(Thread.java:745)

So, how to fix it please :)

Note: this is the source : https://github.com/RedBearLab/Android/tree/master/Examples/Android%20Studio%20Examples/Chat

I am trying to upload an APK from my second computer and it fails with the error below. I copied the release key from Comp. 1 to Comp. 2 and ran the same build scripts. Yet it fails? I bet I am missing something real simple...

You uploaded an APK that is signed with a different certificate to your previous APKs. You must use the same certificate. Your existing APKs are signed with the certificate(s) with fingerprint(s):
[ SHA1: a:hex:key ]
and the certificate(s) used to sign the APK you uploaded have fingerprint(s):
[ SHA1: other:hex:key]

I'm developing with ionic build btw.

Pretty new to android world, I am having an issue playing audio when clicking a button. The interesting/weird aspect of it is that same code works on my mainactivity but not on secondactivity that I have set up. I am using the same exact code that works on mainactivity. I used that code on mainactivity just to test it, keep in mind no media player has been declared or defined in mainactivity. I did that just to test to see if code works.

Here is my xml:

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_marginTop="15sp"
    android:layout_marginBottom="15sp" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="press button to play audio"
        android:textSize="40sp"
        android:textColor="#ffff"
        android:fontFamily="cursive"
        android:textStyle="bold"
        android:layout_marginRight="10dp"
        android:layout_marginLeft="10dp"

        />


</LinearLayout>
<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_marginBottom="10sp"
    android:layout_gravity="center"

    >


    <Button
        android:id="@+id/AudioButton"
        android:layout_width="wrap_content"
        android:layout_height="50sp"
        android:text="play"
        android:textSize="22sp"
        android:textColor="#ffff"
        android:layout_marginRight="10dp"




        />

</LinearLayout>

Here is JAVA:

package nameiscleared;

import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


public class SecondActivity extends AppCompatActivity {



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

    Button start = (Button) findViewById(R.id.AudioButton);




    start.setOnClickListener(new View.OnClickListener() {
        MediaPlayer mp = MediaPlayer.create(getApplicationContext(), R.raw.audioname);

        @Override
        public void onClick(View view) {


            mp.start();
        }
    });
 }
 }