You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/03/25 07:21:29 UTC

[GitHub] [cordova-cli] sagrawal31 opened a new issue #551: Add name of the project in .idea/.name for Android Studio

sagrawal31 opened a new issue #551:
URL: https://github.com/apache/cordova-cli/issues/551


   # Feature Request
   
   ## Motivation Behind Feature
   
   Opening multiple Cordova Android projects in Android Studio leads to confusion that which project to open because it does not show the name, instead, it shows the path (that too trimmed) and just **android** as shown below-
   
   ![image](https://user-images.githubusercontent.com/1804514/112433451-48a7be00-8d68-11eb-953f-873ba8e27e33.png)
   
   
   ## Feature Description
   
   While we run the command `cordova platform add android` or whenever we run `cordova platform run android` or `cordova platform build android`, after creating the Android project skeleton in `platform/android`, simply create a new file in `.idea/.name` which can have the name of the project (possibility picked from `config.xml`).
   
   Nothing else!
   
   Now, when we open this Android project in Android Studio, it can show the name instead of just **android** as shown in the above screenshot.
   
   ## Alternatives or Workarounds
   
   As of now, we do this via Cordova (or Ionic) hooks but we have to do it for every single project.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-cli] breautek commented on issue #551: Add name of the project in .idea/.name for Android Studio

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #551:
URL: https://github.com/apache/cordova-cli/issues/551#issuecomment-806602800


   I'll move this over to cordova-android repo because should this be implemented, it would be handled there as that's the repo that manages the android platform.
   
   I do think this is a good idea and I'll support a PR for it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-cli] sagrawal31 commented on issue #551: Add name of the project in .idea/.name for Android Studio

Posted by GitBox <gi...@apache.org>.
sagrawal31 commented on issue #551:
URL: https://github.com/apache/cordova-cli/issues/551#issuecomment-806427589


   We do it by adding this snippet in our hooks-
   
   ```javascript
   /**
    * Write the name of the app in "platforms/android/.idea/.name" so that Android Studio can show that name in the project listing.
    * This is just for a quick look in the Android Studio if we have so many projects in Android Studio.
    * @param partner
    */
   function addNameForAndroidStudio(partner, name) {
       const path = 'platforms/android/.idea/';
   
       fs.mkdirSync(path)
       fs.writeFileSync(path + '.name', name);
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org